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/components/EmptyState/EmptyState.tsx | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/components') 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}

-- cgit v1.2.3