All files / src/components GenericHeaderSection.js

100% Statements 8/8
87.5% Branches 7/8
100% Functions 2/2
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44                    61x 1194x 1194x 1194x 1194x                         1194x   1194x                            
import React from 'react';
import Box from '@material-ui/core/Box'
import Container from '@material-ui/core/Container';
import Grid from '@material-ui/core/Grid';
import Typography from '@material-ui/core/Typography';
import { NavBreadcrumbs,TitleSection } from './index'
import { makeStyles } from '@material-ui/core/styles';
 
 
 
const GenericHeaderSection = ({ mainTitle,children, breadCrumbLinks,lg,md,sm,subText }) => {
  const lgHeight  = lg || 'auto';
  const mdHeight =  !md ? lg : md;
  const smHeight =  !md ? lg : sm;
  const useStyles = makeStyles((theme) => ({
    headerContainerStyle: {
      height:'auto',
      minHeight:lgHeight,
      [theme.breakpoints.down('md')]: {
        minHeight:mdHeight,
      },
      [theme.breakpoints.down('sm')]: {
        minHeight:smHeight,
      },
    },
 
  }));
  const classes = useStyles();
 
  return (
    <Box className='boxBackground'>
      <Container className={classes.headerContainerStyle}>
        <NavBreadcrumbs crumbs={breadCrumbLinks} />
        <Grid container justify="center">
          {subText && (<Typography variant='h4' fontFamily='Space Mono' color='textSecondary' >Civic Tech Index</Typography>)}
          <TitleSection>{mainTitle}</TitleSection>
          {children}
        </Grid>
      </Container>
    </Box>
  )
}
export default GenericHeaderSection;