aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ContentSection/ContentSection.tsx
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2021-01-14 19:27:47 +0200
committerGitHub <noreply@github.com>2021-01-14 19:27:47 +0200
commite1d1bb966cca5e1541d5703505cfa83e6ae12ec0 (patch)
treed803e0e891fc6c14ff2a390beeabbe59d0ad8485 /src/lib/ContentSection/ContentSection.tsx
parentd23df805ed5d0e78c604d5c9f81f21bbc6a06288 (diff)
parentef9dfdacf17c62254331140a40a508549aa725b4 (diff)
downloadreact-benzin-e1d1bb966cca5e1541d5703505cfa83e6ae12ec0.tar.gz
Merge pull request #22 from eug-vs/develop4.1.0master
Release 4.1.0
Diffstat (limited to 'src/lib/ContentSection/ContentSection.tsx')
-rw-r--r--src/lib/ContentSection/ContentSection.tsx51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/lib/ContentSection/ContentSection.tsx b/src/lib/ContentSection/ContentSection.tsx
deleted file mode 100644
index f18684c..0000000
--- a/src/lib/ContentSection/ContentSection.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import React from 'react';
-
-import {
- Typography,
- Divider,
- makeStyles,
- useMediaQuery,
- Theme,
-} from '@material-ui/core';
-
-
-interface PropTypes {
- sectionName: string;
- level?: number;
-}
-
-const useStyles = makeStyles(theme => ({
- content: {
- [theme.breakpoints.up('md')]: {
- padding: theme.spacing(2, 2, 1, 3),
- },
- [theme.breakpoints.down('sm')]: {
- padding: theme.spacing(2, 0),
- },
- marginBottom: theme.spacing(1),
- },
-}));
-
-const ContentSection: React.FC<PropTypes> = ({ sectionName, children, level = 0 }) => {
- const classes = useStyles();
- const isMobile = useMediaQuery((theme: Theme) => theme.breakpoints.down('sm'));
-
- let adjustedLevel = level + 2; // Make everything smaller
- if (adjustedLevel > 6) adjustedLevel = 6;
-
- type Variant = 'h3' | 'h4' | 'h5' | 'h6';
- const variant: Variant = `h${adjustedLevel}` as Variant;
-
- return (
- <>
- <Typography variant={variant}>{sectionName}</Typography>
- <Divider variant={isMobile ? 'fullWidth' : 'middle'} />
- <Typography component="div" className={classes.content}>
- {children}
- </Typography>
- </>
- );
-};
-
-
-export default ContentSection;