-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4679 from UniversityOfHelsinkiCS/material-ui-fron…
…tpage Material UI: Front page
- Loading branch information
Showing
17 changed files
with
264 additions
and
221 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
14 changes: 10 additions & 4 deletions
14
services/frontend/src/components/material/PageTitle/index.tsx
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 |
---|---|---|
@@ -1,16 +1,22 @@ | ||
import { Box, Typography } from '@mui/material' | ||
import { Stack, Typography } from '@mui/material' | ||
|
||
/** | ||
* A title text displayed at the top of the page. | ||
* | ||
* @param {string} [subtitle] - The subtitle of the page. | ||
* @param {string} title - The main title of the page. | ||
*/ | ||
export const PageTitle = ({ title }: { title: string }) => { | ||
export const PageTitle = ({ subtitle, title }: { subtitle?: string; title: string }) => { | ||
return ( | ||
<Box my={3}> | ||
<Stack sx={{ gap: 1, my: 3, textAlign: 'center' }}> | ||
<Typography component="h1" variant="h4"> | ||
{title} | ||
</Typography> | ||
</Box> | ||
{subtitle && ( | ||
<Typography color="text.secondary" component="h2" variant="h6"> | ||
{subtitle} | ||
</Typography> | ||
)} | ||
</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
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,21 @@ | ||
import { Card, Typography } from '@mui/material' | ||
import ReactMarkdown from 'react-markdown' | ||
|
||
import { getDescription } from '@/common' | ||
import { DISPLAY_DATE_FORMAT } from '@/constants/date' | ||
import { Release } from '@/shared/types' | ||
import { reformatDate } from '@/util/timeAndDate' | ||
|
||
export const ReleaseCard = ({ isLoading, release }: { isLoading: boolean; release: Release }) => { | ||
return ( | ||
<Card elevation={1} sx={{ padding: 2 }} variant="outlined"> | ||
<Typography component="h4" sx={{ mb: 1 }} variant="h6"> | ||
{isLoading ? 'Loading title...' : release.title} | ||
</Typography> | ||
<Typography component="p" sx={{ color: 'text.secondary', mb: 2 }} variant="caption"> | ||
{isLoading ? 'Loading date...' : `Released on ${reformatDate(release.time, DISPLAY_DATE_FORMAT)}`} | ||
</Typography> | ||
<ReactMarkdown>{isLoading ? 'Loading description...' : getDescription(release.description)}</ReactMarkdown> | ||
</Card> | ||
) | ||
} |
Oops, something went wrong.