diff options
author | eug-vs <eug-vs@keemail.me> | 2020-08-15 03:48:53 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-08-15 03:49:41 +0300 |
commit | bf47681e325e18edb3b5bfa4c655095189697e8b (patch) | |
tree | a224f51dcb68b27925d0ed1b89bf6bb2809486ca /src/components/EmptyState/EmptyState.tsx | |
parent | 237d16c273a47e68254f9fa76d3190d28a257ca6 (diff) | |
download | which-ui-bf47681e325e18edb3b5bfa4c655095189697e8b.tar.gz |
refactor: separate Message component
Diffstat (limited to 'src/components/EmptyState/EmptyState.tsx')
-rw-r--r-- | src/components/EmptyState/EmptyState.tsx | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/components/EmptyState/EmptyState.tsx b/src/components/EmptyState/EmptyState.tsx index 214bb56..f79a391 100644 --- a/src/components/EmptyState/EmptyState.tsx +++ b/src/components/EmptyState/EmptyState.tsx @@ -1,6 +1,7 @@ import React from 'react'; -import Typography from '@material-ui/core/Typography'; import { makeStyles } from '@material-ui/core/styles'; + +import Message from '../Message/Message'; import noContentIcon from '../../assets/noContent.svg'; import constructionIcon from '../../assets/construction.svg'; @@ -11,17 +12,9 @@ interface PropTypes { } const useStyles = makeStyles(theme => ({ - root: { - display: 'flex', - flexDirection: 'column', - justifyContent: 'center', - alignItems: 'center' - }, img: { - margin: theme.spacing(2), width: theme.spacing(24) } - })); const CONTEXT = { @@ -37,21 +30,12 @@ const CONTEXT = { const EmptyState: React.FC<PropTypes> = ({ variant = 'default', message }) => { const classes = useStyles(); - const { icon, tagline } = CONTEXT[variant]; return ( - <div className={classes.root}> + <Message tagline={tagline} message={message}> <img src={icon} className={classes.img} alt="No content" /> - <Typography variant="h5"> - {tagline} - </Typography> - <Typography color="textSecondary"> - <p> - {message} - </p> - </Typography> - </div> + </Message> ); }; |