aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ContentSection
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2020-04-18 21:31:11 +0300
committerGitHub <noreply@github.com>2020-04-18 21:31:11 +0300
commitdee39c8ff8e9a417ba2b338beb942f9ad443adf3 (patch)
treea6b1bfa00f5ad925d57d3ded655a8103b911fad4 /src/lib/ContentSection
parent62df0ff96fc9ab832212d223150862c7667d9ffc (diff)
parent0c061c74bfd473be17be755cd19c8952dc115a91 (diff)
downloadreact-benzin-dee39c8ff8e9a417ba2b338beb942f9ad443adf3.tar.gz
Merge pull request #13 from eug-vs/develop
Patch 3.1.1
Diffstat (limited to 'src/lib/ContentSection')
-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>
</>
);
-
};