nof.moe/src/StickyFooter.tsx

62 lines
1.6 KiB
TypeScript
Raw Normal View History

2023-03-30 15:20:21 +00:00
import * as React from 'react';
import CssBaseline from '@mui/material/CssBaseline';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import Container from '@mui/material/Container';
import Link from '@mui/material/Link';
function Copyright() {
return (
<Typography variant="body2" color="text.secondary">
{'Copyright © '}
2023-03-30 16:11:28 +00:00
<Link color="inherit" href="https://github.com/Nofsted095">
2023-03-30 15:34:10 +00:00
Nofated
2023-03-30 15:20:21 +00:00
</Link>{' '}
{new Date().getFullYear()}
{'.'}
</Typography>
2023-03-30 16:11:28 +00:00
2023-03-30 15:20:21 +00:00
);
}
export default function StickyFooter() {
return (
<Box
sx={{
display: 'flex',
flexDirection: 'column',
minHeight: '100vh',
}}
>
<CssBaseline />
<Container component="main" sx={{ mt: 8, mb: 2 }} maxWidth="sm">
<Typography variant="h2" component="h1" gutterBottom>
Sticky footer
</Typography>
<Typography variant="h5" component="h2" gutterBottom>
{'Pin a footer to the bottom of the viewport.'}
{'The footer will move as the main element of the page grows.'}
</Typography>
<Typography variant="body1">Sticky footer placeholder.</Typography>
</Container>
<Box
component="footer"
sx={{
py: 3,
px: 2,
mt: 'auto',
backgroundColor: (theme) =>
theme.palette.mode === 'light'
? theme.palette.grey[200]
: theme.palette.grey[800],
}}
>
<Container maxWidth="sm">
2023-03-30 15:34:10 +00:00
2023-03-30 15:20:21 +00:00
<Copyright />
</Container>
</Box>
</Box>
);
}