-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
KimiaMontazeri
committed
Nov 25, 2023
1 parent
032b4a7
commit d0719c4
Showing
4 changed files
with
133 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { Box, Divider, Stack, Skeleton, Typography } from '@mui/material'; | ||
import PresenterCard from '../../components/presenters/PresenterCard.jsx'; | ||
import useStaff from './useStaff.js'; | ||
import '../../css/Presenters.css'; | ||
|
||
const StaffSection = ({ section, people }) => { | ||
return ( | ||
<Stack | ||
flexDirection="column" | ||
justifyContent="center" | ||
alignItems="center" | ||
gap={2} | ||
sx={{ borderRadius: 4, bgcolor: 'var(--background-color)', mx: 20, px: 20, pb: 10 }} | ||
> | ||
<Box sx={{ width: '100%' }}> | ||
<Divider sx={{ py: 3 }}> | ||
<Typography variant="h2" fontSize="24px"> | ||
{section} | ||
</Typography> | ||
</Divider> | ||
</Box> | ||
<Stack | ||
useFlexGap | ||
flexWrap="wrap" | ||
direction="row" | ||
justifyContent="center" | ||
className="presenters-container" | ||
gap={5} | ||
> | ||
{people.map((member, index) => ( | ||
<PresenterCard | ||
key={index} | ||
name={member.name} | ||
photo={member.img} | ||
role={member.role} | ||
showButton={false} | ||
containerHeight={350} | ||
/> | ||
))} | ||
</Stack> | ||
</Stack> | ||
); | ||
}; | ||
|
||
export default function PresenterPage() { | ||
const { staff } = useStaff(); | ||
|
||
if (staff) { | ||
return ( | ||
<Stack> | ||
<Typography variant="h1" fontSize="50px" sx={{ textAlign: 'center', pb: 5 }}> | ||
Staff Members | ||
</Typography> | ||
<Stack justifyContent="center" alignItems="center" gap={5}> | ||
{staff.map((item, index) => ( | ||
<StaffSection section={item.section} people={item.people} key={index} /> | ||
))} | ||
</Stack> | ||
</Stack> | ||
); | ||
} | ||
|
||
return ( | ||
<Stack> | ||
<Typography variant="h1" fontSize="50px" sx={{ textAlign: 'center', pb: 5 }}> | ||
Staff Members | ||
</Typography> | ||
<Stack useFlexGap flexWrap="wrap" direction="row" justifyContent="center" gap={2}> | ||
{new Array(8).fill( | ||
<Skeleton | ||
variant="rounded" | ||
animation="wave" | ||
width={330} | ||
height={360} | ||
sx={{ bgColor: 'var(--background-color-lighter-20)', borderRadius: 10 }} | ||
/>, | ||
)} | ||
</Stack> | ||
</Stack> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { useEffect, useState } from 'react'; | ||
import { useAPI } from '../../providers/APIProvider/APIProvider'; | ||
|
||
export default function usePresenterPage() { | ||
const { staffData, getStaffData } = useAPI(); | ||
const [staff, setStaff] = useState(); | ||
useEffect(() => { | ||
getStaffData(); | ||
}, []); | ||
|
||
useEffect(() => { | ||
if (staffData === null) return; | ||
setStaff(staffData); | ||
}, [staffData]); | ||
|
||
return { | ||
staff, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters