aboutsummaryrefslogtreecommitdiff
path: root/src/components/Message/Message.tsx
blob: f568552458d202d56e82ce0346dce99902e95aa5 (plain)
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
import React from 'react';
import Typography from '@material-ui/core/Typography';
import { makeStyles } from '@material-ui/core/styles';


interface PropTypes {
  tagline?: string;
  message?: string;
}

const useStyles = makeStyles(theme => ({
  root: {
    display: 'flex',
    flexDirection: 'column',
    justifyContent: 'center',
    alignItems: 'center',
    marginTop: theme.spacing(6)
  },
  content: {
    margin: theme.spacing(2)
  }
}));

const Message: React.FC<PropTypes> = React.memo(({ tagline, message, children }) => {
  const classes = useStyles();

  return (
    <div className={classes.root}>
      <div className={classes.content}>
        {children}
      </div>
      <Typography variant="h5">
        {tagline}
      </Typography>
      <Typography color="textSecondary">
        {message}
      </Typography>
    </div>
  );
});

export default Message;