diff --git a/frontend/src/Components/presenters/PresenterCard.jsx b/frontend/src/Components/presenters/PresenterCard.jsx index c215d92..3d6ddd9 100644 --- a/frontend/src/Components/presenters/PresenterCard.jsx +++ b/frontend/src/Components/presenters/PresenterCard.jsx @@ -1,17 +1,16 @@ import React from 'react'; -import { Box, Button, Card, CardActions, CardContent, Chip, Stack, Typography } from '@mui/material'; +import { Box, Button, Card, CardActions, CardContent, Chip, Divider, Stack, Typography } from '@mui/material'; import PropTypes from 'prop-types'; import '../../css/PresenterCard.css'; import URL from '../../providers/APIProvider/URL.js'; import Image from '../image/Image.jsx'; -const PresenterCard = ({ name, photo, desc, logo, onClick, showButton = true, showDivider = true, role }) => { +const PresenterCard = ({ name, photo, desc, logo, onClick, showButton = true, role, containerHeight }) => { return ( + variant="h5" + > {name} - {role && } + {role && } {logo && ( - + - + {desc} @@ -95,8 +103,8 @@ PresenterCard.propTypes = { desc: PropTypes.string, onClick: PropTypes.func, showButton: PropTypes.bool, - showDivider: PropTypes.bool, role: PropTypes.string, + containerHeight: PropTypes.number, }; export default PresenterCard; diff --git a/frontend/src/pages/Staff/Staff.jsx b/frontend/src/pages/Staff/Staff.jsx new file mode 100644 index 0000000..528514c --- /dev/null +++ b/frontend/src/pages/Staff/Staff.jsx @@ -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 ( + + + + + {section} + + + + + {people.map((member, index) => ( + + ))} + + + ); +}; + +export default function PresenterPage() { + const { staff } = useStaff(); + + if (staff) { + return ( + + + Staff Members + + + {staff.map((item, index) => ( + + ))} + + + ); + } + + return ( + + + Staff Members + + + {new Array(8).fill( + , + )} + + + ); +} diff --git a/frontend/src/pages/Staff/useStaff.js b/frontend/src/pages/Staff/useStaff.js new file mode 100644 index 0000000..b7673bf --- /dev/null +++ b/frontend/src/pages/Staff/useStaff.js @@ -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, + }; +} diff --git a/frontend/src/providers/config-provider/ROUTES.jsx b/frontend/src/providers/config-provider/ROUTES.jsx index 4307776..60e0e93 100644 --- a/frontend/src/providers/config-provider/ROUTES.jsx +++ b/frontend/src/providers/config-provider/ROUTES.jsx @@ -4,6 +4,7 @@ import PresenterDetailPage from '../../pages/presenters/PresenterDetailPage.jsx' import PresenterPage from '../../pages/presenters/PresentersPage.jsx'; import SchedulePage from '../../pages/schedule/SchedulePage.jsx'; import Signup from '../../pages/Signup/Signup.jsx'; +import Staff from '../../pages/Staff/Staff.jsx'; import WorkshopsPage from '../../pages/workshops/WorkshopsPage.jsx'; const ROUTES = { @@ -28,31 +29,16 @@ const ROUTES = { title: 'talks', component: , }, - // committee: { - // path: "/committee", - // title: "Committee", - // }, schedule: { path: '/schedule', title: 'Schedule', component: , }, - // organizer: { - // path: "/organizer", - // title: "Organizer", - // }, - // wnp: { - // path: "/wnp", - // title: "Workshops and Presentations", - // }, staff: { path: '/staff', title: 'Staff', + component: , }, - // history: { - // path: '/history', - // title: 'History', - // }, signup: { path: '/signup', title: 'Signup',