From 1d35dd8a80f0ea72306e96c2229a27798ec75ce9 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Fri, 14 Aug 2020 04:59:45 +0300 Subject: feat: use EmptyState variants --- src/assets/construction.svg | 1 + src/components/EmptyState/EmptyState.tsx | 22 +++++++++++++++++++--- src/containers/Notifications/Notifications.tsx | 11 +++++------ 3 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 src/assets/construction.svg diff --git a/src/assets/construction.svg b/src/assets/construction.svg new file mode 100644 index 0000000..bdb9eaa --- /dev/null +++ b/src/assets/construction.svg @@ -0,0 +1 @@ +towing \ No newline at end of file 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 = ({ message }) => { +const CONTEXT = { + default: { + icon: noContentIcon, + tagline: 'No content' + }, + construction: { + icon: constructionIcon, + tagline: 'Coming soon' + } +}; + +const EmptyState: React.FC = ({ variant = 'default', message }) => { const classes = useStyles(); + const { icon, tagline } = CONTEXT[variant]; + return (
- No content + No content - No content + {tagline}

diff --git a/src/containers/Notifications/Notifications.tsx b/src/containers/Notifications/Notifications.tsx index 0648eb5..2a9ea13 100644 --- a/src/containers/Notifications/Notifications.tsx +++ b/src/containers/Notifications/Notifications.tsx @@ -1,11 +1,10 @@ import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; -import { Typography } from '@material-ui/core'; +import EmptyState from '../../components/EmptyState/EmptyState'; const useStyles = makeStyles(theme => ({ root: { - marginTop: theme.spacing(25), - textAlign: 'center' + marginTop: theme.spacing(25) } })); @@ -13,9 +12,9 @@ const Notifications: React.FC = () => { const classes = useStyles(); return ( - - Sorry, this page is being constructed yet. - +

+ +
); }; -- cgit v1.2.3