aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ContentSection/ContentSection.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ContentSection/ContentSection.tsx')
-rw-r--r--src/lib/ContentSection/ContentSection.tsx11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/ContentSection/ContentSection.tsx b/src/lib/ContentSection/ContentSection.tsx
index ba8b882..28b1ad5 100644
--- a/src/lib/ContentSection/ContentSection.tsx
+++ b/src/lib/ContentSection/ContentSection.tsx
@@ -3,7 +3,7 @@ import React from 'react';
import {
Typography,
Divider,
- makeStyles
+ makeStyles,
} from '@material-ui/core';
@@ -26,22 +26,21 @@ const useStyles = makeStyles(theme => ({
const ContentSection: React.FC<PropTypes> = ({ sectionName, children, level = 0 }) => {
const classes = useStyles();
- level += 2; // Make everything smaller
- if (level > 6) level = 6;
+ let adjustedLevel = level + 2; // Make everything smaller
+ if (adjustedLevel > 6) adjustedLevel = 6;
type Variant = 'h3' | 'h4' | 'h5' | 'h6';
- const variant: Variant = 'h' + level as Variant;
+ const variant: Variant = `h${adjustedLevel}` as Variant;
return (
<>
<Typography variant={variant}>{sectionName}</Typography>
- <Divider variant="middle"/>
+ <Divider variant="middle" />
<Typography component="div" className={classes.content}>
{children}
</Typography>
</>
);
-
};