aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ContentSection/ContentSection.tsx
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2020-04-18 21:17:50 +0300
committerGitHub <noreply@github.com>2020-04-18 21:17:50 +0300
commit1d1df03b64d31a9606e494d086eb7ae3bee92681 (patch)
tree5bea19d0bc6afc0440f71fb8df962e29fbb568e2 /src/lib/ContentSection/ContentSection.tsx
parentad42e742c04c8302c2bcaf67c07ef215bba04f3b (diff)
parenta31244374f5609e89d8ff22e4111ab04d94886a2 (diff)
downloadreact-benzin-1d1df03b64d31a9606e494d086eb7ae3bee92681.tar.gz
Merge pull request #12 from eug-vs/codestyle
Configure ESlint properly
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>
</>
);
-
};