-
-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathContentHeader.tsx
More file actions
63 lines (61 loc) · 1.25 KB
/
ContentHeader.tsx
File metadata and controls
63 lines (61 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import React from 'react';
import { Box, Grid, Typography } from '@mui/material';
/**
* Display a header.
*
* Used to display the main title of nearly every page.
*
* If `chipLabel` is provided, display a MUI <Chip> at the end of the
* header.
*/
const ContentHeader = ({
title,
subtitle,
}: {
title: string;
subtitle?: React.ReactNode;
}) => {
return (
<Box
sx={{
px: [2, 4],
pt: 2,
color: 'text.secondary',
}}
>
<Grid
container
spacing={1}
sx={{
justifyContent: 'space-between',
}}
>
<Grid item>
<Typography
variant="h4"
component="h2"
sx={(theme) => ({
textDecorationLine: 'underline',
textDecorationColor: theme.palette.primary.light,
textDecorationThickness: '0.6em',
textDecorationSkipInk: 'none',
textUnderlineOffset: '-0.1em',
})}
>
{title}
</Typography>
</Grid>
</Grid>
{subtitle && (
<Typography
sx={{
mt: 1,
}}
>
{subtitle}
</Typography>
)}
</Box>
);
};
export default ContentHeader;