From 40cc9f63feb15e1bb14c5360b4437d3379df96e2 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Thu, 8 Oct 2020 20:21:10 +0300
Subject: feat: add noMargin prop to Message

---
 src/components/Message/Message.tsx | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

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

diff --git a/src/components/Message/Message.tsx b/src/components/Message/Message.tsx
index f568552..e5191ed 100644
--- a/src/components/Message/Message.tsx
+++ b/src/components/Message/Message.tsx
@@ -6,6 +6,7 @@ import { makeStyles } from '@material-ui/core/styles';
 interface PropTypes {
   tagline?: string;
   message?: string;
+  noMargin?: boolean;
 }
 
 const useStyles = makeStyles(theme => ({
@@ -13,7 +14,9 @@ const useStyles = makeStyles(theme => ({
     display: 'flex',
     flexDirection: 'column',
     justifyContent: 'center',
-    alignItems: 'center',
+    alignItems: 'center'
+  },
+  margin: {
     marginTop: theme.spacing(6)
   },
   content: {
@@ -21,11 +24,11 @@ const useStyles = makeStyles(theme => ({
   }
 }));
 
-const Message: React.FC<PropTypes> = React.memo(({ tagline, message, children }) => {
+const Message: React.FC<PropTypes> = React.memo(({ tagline, message, noMargin, children }) => {
   const classes = useStyles();
 
   return (
-    <div className={classes.root}>
+    <div className={`${classes.root} ${!noMargin && classes.margin}`}>
       <div className={classes.content}>
         {children}
       </div>
-- 
cgit v1.2.3

