diff options
author | eug-vs <eug-vs@keemail.me> | 2020-08-14 04:59:45 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-08-14 04:59:45 +0300 |
commit | 1d35dd8a80f0ea72306e96c2229a27798ec75ce9 (patch) | |
tree | 022abcb444cda09f98c2d43accc2fdd85aeb2a82 /src/components | |
parent | c30f59c85d8c57a9250635d96e3a295345c45ba7 (diff) | |
download | which-ui-1d35dd8a80f0ea72306e96c2229a27798ec75ce9.tar.gz |
feat: use EmptyState variants
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/EmptyState/EmptyState.tsx | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/components/EmptyState/EmptyState.tsx b/src/components/EmptyState/EmptyState.tsx index f6a6363..214bb56 100644 --- a/src/components/EmptyState/EmptyState.tsx +++ b/src/components/EmptyState/EmptyState.tsx @@ -2,8 +2,11 @@ import React from 'react'; import Typography from '@material-ui/core/Typography'; import { makeStyles } from '@material-ui/core/styles'; import noContentIcon from '../../assets/noContent.svg'; +import constructionIcon from '../../assets/construction.svg'; + interface PropTypes { + variant?: 'default' | 'construction'; message?: string; } @@ -21,14 +24,27 @@ const useStyles = makeStyles(theme => ({ })); -const EmptyState: React.FC<PropTypes> = ({ message }) => { +const CONTEXT = { + default: { + icon: noContentIcon, + tagline: 'No content' + }, + construction: { + icon: constructionIcon, + tagline: 'Coming soon' + } +}; + +const EmptyState: React.FC<PropTypes> = ({ variant = 'default', message }) => { const classes = useStyles(); + const { icon, tagline } = CONTEXT[variant]; + return ( <div className={classes.root}> - <img src={noContentIcon} className={classes.img} alt="No content" /> + <img src={icon} className={classes.img} alt="No content" /> <Typography variant="h5"> - No content + {tagline} </Typography> <Typography color="textSecondary"> <p> |