update App.js, src/components/CourseChapter/index.js, src/components/NumOfGuestsEmployees/index.js and src/components/ReligiousTimes/index.js
parent
ee043fea31
commit
9efb249520
4 changed files with 133 additions and 146 deletions
@ -1,42 +1,65 @@ |
||||
import React from 'react' |
||||
import React from "react"; |
||||
|
||||
const NumOfGuestsEmployees = ({items}) => { |
||||
const NumOfGuestsEmployees = ({ items }) => { |
||||
console.log(items); |
||||
return ( |
||||
<div className="flex flex-row flex-wrap items-center justify-center bg-white shadow-sm rounded-lg max-w-[280px] w-1/3 mt-10 mr-10 py-2"> |
||||
{items.map((item,i) => ( |
||||
<div className="flex flex-row"> |
||||
<div className="font-bold text-xs flex flex-col items-center"> |
||||
<p className="text-[#0F0543]">{item.name}</p> |
||||
<span className="text-[#2483E1] mt-2">{item.number} نفر</span> |
||||
</div> |
||||
{Number(i) !== items.length -1 && ( |
||||
<div className="w-0.5 bg-[#9DACD344] mx-3" style={{height: "44px"}}></div> |
||||
)} |
||||
<div className="mt-20 flex flex-col items-center gap-y-4 max-w-[400px] mx-auto bg-white shadow-sm rounded-lg p-3"> |
||||
{items.map((row, index) => ( |
||||
<div |
||||
className={`flex flex-row items-center justify-around w-full border-gray-200 pb-3 ${ |
||||
index + 1 < items.length ? "border-b" : "" |
||||
}`}
|
||||
key={index} |
||||
> |
||||
{row.map((item, index) => ( |
||||
<div |
||||
className={`flex flex-col items-center font-bold text-xs border-gray-200 flex-1 ${ |
||||
index + 1 < row.length ? "border-l" : "" |
||||
}`}
|
||||
> |
||||
<p className="text-[#0F0543]">{item.name}</p> |
||||
<span |
||||
className={` mt-2 ${ |
||||
item.remaining ? "text-[#E16524]" : "text-[#2483E1]" |
||||
}`}
|
||||
> |
||||
{item.number} نفر |
||||
</span> |
||||
</div> |
||||
))} |
||||
</div> |
||||
) |
||||
} |
||||
))} |
||||
</div> |
||||
))} |
||||
</div> |
||||
); |
||||
}; |
||||
|
||||
export default NumOfGuestsEmployees |
||||
export default NumOfGuestsEmployees; |
||||
|
||||
NumOfGuestsEmployees.defaultProps = { |
||||
items: [ |
||||
{ |
||||
name: "تعداد کارمندان محترم", |
||||
number: "259", |
||||
}, |
||||
{ |
||||
name: "تعداد مهمانان محترم", |
||||
number: "569", |
||||
}, |
||||
// {
|
||||
// name: "ظرفیت باقیمانده کارمندان محترم",
|
||||
// number: "5",
|
||||
// },
|
||||
// {
|
||||
// name: "ظرفیت باقیمانده مهمانان محترم",
|
||||
// number: "6",
|
||||
// },
|
||||
] |
||||
} |
||||
items: [ |
||||
[ |
||||
{ |
||||
name: "تعداد کارمندان محترم", |
||||
number: "259", |
||||
remaining: false, |
||||
}, |
||||
{ |
||||
name: "تعداد مهمانان محترم", |
||||
number: "569", |
||||
remaining: false, |
||||
}, |
||||
], |
||||
[ |
||||
{ |
||||
name: "ظرفیت باقیمانده کارمندان محترم", |
||||
number: "5", |
||||
remaining: true, |
||||
}, |
||||
{ |
||||
name: "ظرفیت باقیمانده مهمانان محترم", |
||||
number: "6", |
||||
remaining: true, |
||||
}, |
||||
], |
||||
], |
||||
}; |
||||
|
@ -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 ( |
||||
<div className="flex flex-row items-center justify-center bg-white shadow-sm rounded-lg max-w-[465px] w-1/3 py-3.5 px-0.5 mt-10 mr-10"> |
||||
{hours.map((hour,index) => ( |
||||
<div className="flex flex-row items-center" key={index}> |
||||
<span className="text-xs text-[#0F0543] font-bold"> |
||||
{hour.partOfDay} |
||||
</span> |
||||
<span className="text-xs text-[#2483E1] font-bold mr-1"> |
||||
{hour.time} |
||||
</span> |
||||
{Number(index) !== hours.length -1 && ( |
||||
<div className="w-0.5 bg-[#9DACD344] mx-2" style={{height: "20px"}}></div> |
||||
)} |
||||
</div> |
||||
))} |
||||
{hours.map((hour, index) => ( |
||||
<div className="flex flex-row items-center" key={index}> |
||||
<span className="text-xs text-[#0F0543] font-bold"> |
||||
{hour.partOfDay} |
||||
</span> |
||||
<span className="text-xs text-[#2483E1] font-bold mr-1"> |
||||
{hour.time} |
||||
</span> |
||||
{Number(index) !== hours.length - 1 && ( |
||||
<div |
||||
className="w-0.5 bg-[#9DACD344] mx-2" |
||||
style={{ height: "20px" }} |
||||
></div> |
||||
)} |
||||
</div> |
||||
))} |
||||
</div> |
||||
) |
||||
} |
||||
); |
||||
}; |
||||
|
||||
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", |
||||
}, |
||||
] |
||||
} |
||||
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", |
||||
}, |
||||
], |
||||
}; |
||||
|
Loading…
Reference in new issue