Skip to content

Commit d87a426

Browse files
committed
#4088 responsive + markdown support
1 parent 06a0a7e commit d87a426

1 file changed

Lines changed: 16 additions & 9 deletions

File tree

src/frontend/src/pages/GuestTeamsPage/GuestTeamSpecificPage.tsx

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Box, Grid, Stack, Typography } from '@mui/material';
1+
import { Box, Stack, Typography } from '@mui/material';
2+
import { useMediaQuery } from '@mui/system';
23
import { useSingleTeam } from '../../hooks/teams.hooks';
34
import { useParams } from 'react-router-dom';
45
import LoadingIndicator from '../../components/LoadingIndicator';
@@ -10,6 +11,7 @@ import PersonOutlineOutlinedIcon from '@mui/icons-material/PersonOutlineOutlined
1011
import GroupOutlinedIcon from '@mui/icons-material/GroupOutlined';
1112
import GroupsOutlinedIcon from '@mui/icons-material/GroupsOutlined';
1213
import GuestProjectsCard from '../GuestProjectsPage/GuestProjectsCard';
14+
import NERMarkdown from '../../components/NERMarkdown';
1315

1416
interface ParamTypes {
1517
teamId: string;
@@ -18,6 +20,7 @@ interface ParamTypes {
1820
const GuestTeamSpecificPage: React.FC = () => {
1921
const { teamId } = useParams<ParamTypes>();
2022
const { isLoading, isError, data, error } = useSingleTeam(teamId);
23+
const isMobilePortrait = useMediaQuery('(max-width:480px)');
2124

2225
if (isError) return <ErrorPage message={error?.message} />;
2326
if (isLoading || !data) return <LoadingIndicator />;
@@ -40,9 +43,7 @@ const GuestTeamSpecificPage: React.FC = () => {
4043
}
4144
>
4245
<Box sx={{ mb: 3 }}>
43-
<Typography variant="body2" sx={{ color: 'text.secondary', lineHeight: 1.7 }}>
44-
{data.description}
45-
</Typography>
46+
<NERMarkdown markdown={data.description} />
4647
</Box>
4748
<Box sx={{ mb: 3 }}>
4849
<Typography variant="h5" fontWeight={700} sx={{ mb: 2 }}>
@@ -92,13 +93,19 @@ const GuestTeamSpecificPage: React.FC = () => {
9293
<Typography variant="h5" fontWeight={700} sx={{ mb: 2 }}>
9394
Active Projects
9495
</Typography>
95-
<Grid container spacing={2}>
96+
<Box
97+
sx={{
98+
display: 'grid',
99+
gridTemplateColumns: isMobilePortrait ? '1fr' : 'repeat(3, 1fr)',
100+
gap: isMobilePortrait ? 2 : 3,
101+
width: '100%',
102+
px: isMobilePortrait ? 1 : 0
103+
}}
104+
>
96105
{activeProjects.map((project) => (
97-
<Grid item xs={12} sm={6} md={4} key={project.id}>
98-
<GuestProjectsCard project={{ ...project, teamTypes: [] }} />
99-
</Grid>
106+
<GuestProjectsCard key={project.id} project={{ ...project, teamTypes: [] }} />
100107
))}
101-
</Grid>
108+
</Box>
102109
</Box>
103110
</PageLayout>
104111
);

0 commit comments

Comments
 (0)