Skip to content
Snippets Groups Projects
Verified Commit b6f42f66 authored by Rafael László's avatar Rafael László :speech_balloon:
Browse files

Add Members component in about page

parent 6be66a1a
Branches
Tags
2 merge requests!19fix type imports,!16About page
import { Box, CircularProgress, Typography } from '@material-ui/core'; import { Box, CircularProgress, Typography } from '@material-ui/core';
import React from 'react'; import React from 'react';
import { StaffResponse } from '../client/types';
import AboutCard from '../components/AboutCard'; import AboutCard from '../components/AboutCard';
import Gallery from '../components/Gallery'; import Gallery from '../components/Gallery';
import MemberCard from '../components/MemberCard'; import MemberCard from '../components/MemberCard';
import useGetStaff from '../hooks/useGetStaffs'; import useGetStaff from '../hooks/useGetStaffs';
import Page from './Page'; import Page from './Page';
const Members: React.FC<{ data: StaffResponse }> = ({ data }) => {
if (data.length === 0) {
return <Typography>Nincs találat</Typography>;
}
return (
<>
{data?.map((m) => (
<Box m={3} key={m.email}>
<MemberCard
name={m.name}
email={m.email}
acceptedPicture={m.acceptedPicture}
staffMemberText={m.staffMemberText}
/>
</Box>
))}
</>
);
};
const AboutPage: React.FC = () => { const AboutPage: React.FC = () => {
const { data, status } = useGetStaff(); const { data, status } = useGetStaff();
...@@ -26,20 +47,7 @@ const AboutPage: React.FC = () => { ...@@ -26,20 +47,7 @@ const AboutPage: React.FC = () => {
</Typography> </Typography>
</Box> </Box>
<Box marginBottom={8} display="flex" justifyContent="center" flexWrap="wrap"> <Box marginBottom={8} display="flex" justifyContent="center" flexWrap="wrap">
{!data || status === 'loading' ? ( {!data || status === 'loading' ? <CircularProgress /> : <Members data={data} />}
<CircularProgress />
) : (
data?.map((m) => (
<Box m={3} key={m.email}>
<MemberCard
name={m.name}
email={m.email}
acceptedPicture={m.acceptedPicture}
staffMemberText={m.staffMemberText}
/>
</Box>
))
)}
</Box> </Box>
<Box marginY={4}> <Box marginY={4}>
<Typography variant="h4" color="textPrimary"> <Typography variant="h4" color="textPrimary">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment