From 9efb249520f4426301acdb7bd44935422332ada6 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 13 Apr 2022 11:21:20 +0430 Subject: [PATCH] update App.js, src/components/CourseChapter/index.js, src/components/NumOfGuestsEmployees/index.js and src/components/ReligiousTimes/index.js --- src/App.js | 51 ++++----- src/components/CourseChapter/index.js | 30 ------ src/components/NumOfGuestsEmployees/index.js | 95 ++++++++++------- src/components/ReligiousTimes/index.js | 103 +++++++++---------- 4 files changed, 133 insertions(+), 146 deletions(-) diff --git a/src/App.js b/src/App.js index 061f59f..90e8ad7 100644 --- a/src/App.js +++ b/src/App.js @@ -91,8 +91,12 @@ function App() { {/* */} {/* */} {/* */} + {/* */} {/* */} + {/* */} + {/* */} {/* */} + {/* */} {/* */} {/* */} {/* */} @@ -114,7 +118,6 @@ function App() { {/* */} {/* */} {/* */} - {/* */} {/* */} {/* */} {/* */} @@ -124,46 +127,44 @@ function App() { {/* */} {/* */} {/* */} - {/* */} + {/* */} {/* */} - {/* */} - {/*
- - - - - -
*/} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + + {/* *************************************************** mini components *************************************************** */} + {/* */} + {/* */} {/* */} {/* */} - {/* */} {/* */} {/* */} {/* */} - {/* */} {/* */} {/* */} {/* */} {/* */} - {/* */} {/* */} {/* */} - {/* */} - {/* */} - {/* */} - {/* */} - {/* */} {/* */} {/* */} + {/* */} + {/* */} {/* */} - {/* */} + {/*
+ + + + + +
*/} + {/* */} {/* */} - {/* */} - {/* */} - {/* */} - {/* */} - - ); diff --git a/src/components/CourseChapter/index.js b/src/components/CourseChapter/index.js index 82c659b..5a706a9 100644 --- a/src/components/CourseChapter/index.js +++ b/src/components/CourseChapter/index.js @@ -137,35 +137,5 @@ CourseChapter.defaultProps = { }, ], }, - { - title: "فصل اول: مباحث جوشش مواد مذاب در مرکز", - duration: "2:30:13", - lessons: [ - { - title: "آیا گوگل از ما دزدی میکند؟", - duration: "14:30", - play: "پخش", - passed: true, - }, - { - title: "چگونگی ساخت نیروگاه های برقی", - duration: "22:31", - play: "در حال پخش", - passed: true, - }, - { - title: "آیا از اینترنت می توان درآمد داشت؟", - duration: "10:09", - play: "نمایش", - passed: false, - }, - { - title: "زمین سبز و آسمان آبی", - duration: "56:09", - play: "نمایش", - passed: false, - }, - ], - }, ], }; diff --git a/src/components/NumOfGuestsEmployees/index.js b/src/components/NumOfGuestsEmployees/index.js index 4b1d26a..2a9ffe3 100644 --- a/src/components/NumOfGuestsEmployees/index.js +++ b/src/components/NumOfGuestsEmployees/index.js @@ -1,42 +1,65 @@ -import React from 'react' +import React from "react"; -const NumOfGuestsEmployees = ({items}) => { +const NumOfGuestsEmployees = ({ items }) => { + console.log(items); return ( -
- {items.map((item,i) => ( -
-
-

{item.name}

- {item.number} نفر -
- {Number(i) !== items.length -1 && ( -
- )} +
+ {items.map((row, index) => ( +
+ {row.map((item, index) => ( +
+

{item.name}

+ + {item.number} نفر +
- ))} -
- ) -} + ))} +
+ ))} +
+ ); +}; -export default NumOfGuestsEmployees +export default NumOfGuestsEmployees; NumOfGuestsEmployees.defaultProps = { - items: [ - { - name: "تعداد کارمندان محترم", - number: "259", - }, - { - name: "تعداد مهمانان محترم", - number: "569", - }, - // { - // name: "ظرفیت باقیمانده کارمندان محترم", - // number: "5", - // }, - // { - // name: "ظرفیت باقیمانده مهمانان محترم", - // number: "6", - // }, - ] -} \ No newline at end of file + items: [ + [ + { + name: "تعداد کارمندان محترم", + number: "259", + remaining: false, + }, + { + name: "تعداد مهمانان محترم", + number: "569", + remaining: false, + }, + ], + [ + { + name: "ظرفیت باقیمانده کارمندان محترم", + number: "5", + remaining: true, + }, + { + name: "ظرفیت باقیمانده مهمانان محترم", + number: "6", + remaining: true, + }, + ], + ], +}; diff --git a/src/components/ReligiousTimes/index.js b/src/components/ReligiousTimes/index.js index c0d5b90..6cad50a 100644 --- a/src/components/ReligiousTimes/index.js +++ b/src/components/ReligiousTimes/index.js @@ -1,62 +1,55 @@ -import React from 'react' +import React from "react"; -// const time = { -// morningTime: "صبح", -// sunriseTime: "طلوع", -// noonTime: "ظهر", -// sunsetTime: "غروب", -// maghribTime: "مغرب", -// midnightTime: "نیمه شب", -// } - -const ReligiousTimes = ({hours}) => { +const ReligiousTimes = ({ hours }) => { return (
- {hours.map((hour,index) => ( -
- - {hour.partOfDay} - - - {hour.time} - - {Number(index) !== hours.length -1 && ( -
- )} -
- ))} + {hours.map((hour, index) => ( +
+ + {hour.partOfDay} + + + {hour.time} + + {Number(index) !== hours.length - 1 && ( +
+ )} +
+ ))}
- ) -} + ); +}; -export default ReligiousTimes +export default ReligiousTimes; ReligiousTimes.defaultProps = { - - hours : [ - { - partOfDay: "صبح", - time: "5:03", - }, - { - partOfDay: "طلوع", - time: "6:27", - }, - { - partOfDay: "ظهر", - time: "12:15", - }, - { - partOfDay: "غروب", - time: "18:05", - }, - { - partOfDay: "مغرب", - time: "18:23", - }, - { - partOfDay: "نیمه شب", - time: "23:34", - }, - ] -} \ No newline at end of file + hours: [ + { + partOfDay: "صبح", + time: "5:03", + }, + { + partOfDay: "طلوع", + time: "6:27", + }, + { + partOfDay: "ظهر", + time: "12:15", + }, + { + partOfDay: "غروب", + time: "18:05", + }, + { + partOfDay: "مغرب", + time: "18:23", + }, + { + partOfDay: "نیمه شب", + time: "23:34", + }, + ], +};