All files / src/components BottomCallToAction.js

90% Statements 9/10
75% Branches 3/4
100% Functions 1/1
90% Lines 9/10

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                61x 61x 61x   61x 9x 9x 9x     9x       9x                              
import React from 'react';
import Box from '@material-ui/core/Box';
import Button from '@material-ui/core/Button';
import Grid from '@material-ui/core/Grid';
import Typography from '@material-ui/core/Typography';
import { useTheme } from '@material-ui/core';
 
 
const defaultBackgroundColor = 'transparent'; // see https://developer.mozilla.org/en-US/docs/Web/CSS/background-color - 'transparent' is initial value
const defaultButtonHref = 'mailto:civictechindex@hackforla.org';
const defaultButtonText = 'Contact Us';
 
const BottomCallToAction = ({ color, buttonHref = defaultButtonHref, buttonText = defaultButtonText, heading }) => {
  const theme = useTheme();
  let bgColor = defaultBackgroundColor;
  Iif (color === 'primary') {
    bgColor = theme.palette.background.default;
  }
  const boxStyle = {
    backgroundColor: bgColor,
  };
 
  return (
    <Box style={boxStyle} py={8} mx={-3}>
      <Grid container direction='column' justify='center' alignItems='center' spacing={4}>
        <Grid item>
          <Typography variant='h2'>{heading}</Typography>
        </Grid>
        <Grid item>
          <Button href={buttonHref}>{buttonText}</Button>
        </Grid>
      </Grid>
    </Box>
  );
};
 
export default BottomCallToAction;