From bf47681e325e18edb3b5bfa4c655095189697e8b Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Sat, 15 Aug 2020 03:48:53 +0300
Subject: refactor: separate Message component

---
 src/components/Message/Message.tsx | 42 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 src/components/Message/Message.tsx

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

diff --git a/src/components/Message/Message.tsx b/src/components/Message/Message.tsx
new file mode 100644
index 0000000..f568552
--- /dev/null
+++ b/src/components/Message/Message.tsx
@@ -0,0 +1,42 @@
+import React from 'react';
+import Typography from '@material-ui/core/Typography';
+import { makeStyles } from '@material-ui/core/styles';
+
+
+interface PropTypes {
+  tagline?: string;
+  message?: string;
+}
+
+const useStyles = makeStyles(theme => ({
+  root: {
+    display: 'flex',
+    flexDirection: 'column',
+    justifyContent: 'center',
+    alignItems: 'center',
+    marginTop: theme.spacing(6)
+  },
+  content: {
+    margin: theme.spacing(2)
+  }
+}));
+
+const Message: React.FC<PropTypes> = React.memo(({ tagline, message, children }) => {
+  const classes = useStyles();
+
+  return (
+    <div className={classes.root}>
+      <div className={classes.content}>
+        {children}
+      </div>
+      <Typography variant="h5">
+        {tagline}
+      </Typography>
+      <Typography color="textSecondary">
+        {message}
+      </Typography>
+    </div>
+  );
+});
+
+export default Message;
-- 
cgit v1.2.3

