diff options
author | Eugene Sokolov <eug-vs@keemail.me> | 2020-04-05 22:49:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-05 22:49:24 +0300 |
commit | ffa56075c7f92ee0e3a5143fbf2e506eba016143 (patch) | |
tree | 50ec8eee86570cf3cadfa26c73f25c50334f1543 /src/lib/ContentSection/ContentSection.tsx | |
parent | 0a73e37b1bc78fead6a78722568532c327127b54 (diff) | |
parent | e9c6eb6be709db76002c41e5bf7d13654493d0a8 (diff) | |
download | react-benzin-ffa56075c7f92ee0e3a5143fbf2e506eba016143.tar.gz |
Merge pull request #7 from eug-vs/markdown
Markdown proof of concept
Diffstat (limited to 'src/lib/ContentSection/ContentSection.tsx')
-rw-r--r-- | src/lib/ContentSection/ContentSection.tsx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/ContentSection/ContentSection.tsx b/src/lib/ContentSection/ContentSection.tsx index 7ff47f9..ba8b882 100644 --- a/src/lib/ContentSection/ContentSection.tsx +++ b/src/lib/ContentSection/ContentSection.tsx @@ -9,11 +9,12 @@ import { interface PropTypes { sectionName: string; + level?: number; } const useStyles = makeStyles(theme => ({ content: { - padding: theme.spacing(0, 2, 1, 2), + padding: theme.spacing(2, 2, 1, 3), marginBottom: theme.spacing(1), '& .MuiButton-root': { @@ -22,12 +23,18 @@ const useStyles = makeStyles(theme => ({ }, })); -const ContentSection: React.FC<PropTypes> = ({ sectionName, children }) => { +const ContentSection: React.FC<PropTypes> = ({ sectionName, children, level = 0 }) => { const classes = useStyles(); + level += 2; // Make everything smaller + if (level > 6) level = 6; + + type Variant = 'h3' | 'h4' | 'h5' | 'h6'; + const variant: Variant = 'h' + level as Variant; + return ( <> - <Typography variant="h4">{sectionName}</Typography> + <Typography variant={variant}>{sectionName}</Typography> <Divider variant="middle"/> <Typography component="div" className={classes.content}> {children} |