From 6c6b25ae182fdb5d55e0c5800bf0ba60ac0cede5 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Sat, 15 Aug 2020 14:59:48 +0300
Subject: feat: use more cool image

---
 src/components/EmptyState/EmptyState.tsx | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

(limited to 'src/components/EmptyState/EmptyState.tsx')

diff --git a/src/components/EmptyState/EmptyState.tsx b/src/components/EmptyState/EmptyState.tsx
index f79a391..1a8eec5 100644
--- a/src/components/EmptyState/EmptyState.tsx
+++ b/src/components/EmptyState/EmptyState.tsx
@@ -1,14 +1,17 @@
 import React from 'react';
 import { makeStyles } from '@material-ui/core/styles';
 
+import Image from '../Image/Image';
 import Message from '../Message/Message';
 import noContentIcon from '../../assets/noContent.svg';
 import constructionIcon from '../../assets/construction.svg';
+import serverIcon from '../../assets/server.svg';
 
 
 interface PropTypes {
-  variant?: 'default' | 'construction';
+  variant?: 'default' | 'construction' | 'waiting';
   message?: string;
+  smart?: boolean;
 }
 
 const useStyles = makeStyles(theme => ({
@@ -25,16 +28,22 @@ const CONTEXT = {
   construction: {
     icon: constructionIcon,
     tagline: 'Coming soon'
+  },
+  waiting: {
+    icon: serverIcon,
+    tagline: 'Waiting for server'
   }
 };
 
-const EmptyState: React.FC<PropTypes> = ({ variant = 'default', message }) => {
+const EmptyState: React.FC<PropTypes> = ({ variant = 'default', smart = false, message }) => {
   const classes = useStyles();
   const { icon, tagline } = CONTEXT[variant];
 
+  const Component = smart ? Image : 'img';
+
   return (
     <Message tagline={tagline} message={message}>
-      <img src={icon} className={classes.img} alt="No content" />
+      <Component src={icon} className={classes.img} alt="No content" />
     </Message>
   );
 };
-- 
cgit v1.2.3


From 6f82250c15d26b8bfaaff07cda9f6b05c53ef2c4 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Sun, 16 Aug 2020 00:24:09 +0300
Subject: feat: add error boundary

---
 src/components/EmptyState/EmptyState.tsx | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'src/components/EmptyState/EmptyState.tsx')

diff --git a/src/components/EmptyState/EmptyState.tsx b/src/components/EmptyState/EmptyState.tsx
index 1a8eec5..7167ba2 100644
--- a/src/components/EmptyState/EmptyState.tsx
+++ b/src/components/EmptyState/EmptyState.tsx
@@ -6,10 +6,11 @@ import Message from '../Message/Message';
 import noContentIcon from '../../assets/noContent.svg';
 import constructionIcon from '../../assets/construction.svg';
 import serverIcon from '../../assets/server.svg';
+import errorIcon from '../../assets/error.svg';
 
 
 interface PropTypes {
-  variant?: 'default' | 'construction' | 'waiting';
+  variant?: 'default' | 'construction' | 'waiting' | 'error';
   message?: string;
   smart?: boolean;
 }
@@ -32,6 +33,10 @@ const CONTEXT = {
   waiting: {
     icon: serverIcon,
     tagline: 'Waiting for server'
+  },
+  error: {
+    icon: errorIcon,
+    tagline: 'Something went wrong'
   }
 };
 
-- 
cgit v1.2.3

