From a283d4310c11f03fe9ff889c6274798b70cf6a19 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Wed, 7 Oct 2020 23:51:45 +0300
Subject: feat: create ModalScreen component

---
 src/containers/PollCreation/PollCreation.tsx | 58 +++++++++++++---------------
 1 file changed, 26 insertions(+), 32 deletions(-)

(limited to 'src/containers/PollCreation/PollCreation.tsx')

diff --git a/src/containers/PollCreation/PollCreation.tsx b/src/containers/PollCreation/PollCreation.tsx
index ecc6757..079c79f 100644
--- a/src/containers/PollCreation/PollCreation.tsx
+++ b/src/containers/PollCreation/PollCreation.tsx
@@ -5,7 +5,6 @@ import { makeStyles } from '@material-ui/core/styles';
 import {
   Button,
   Card,
-  Divider,
   Container,
   LinearProgress
 } from '@material-ui/core';
@@ -13,16 +12,12 @@ import { useSnackbar } from 'notistack';
 
 import useS3Preupload from './useS3Preupload';
 import ImageInput from './ImageInput';
-import UserStrip from '../../components/UserStrip/UserStrip';
+import ModalScreen from '../../components/ModalScreen/ModalScreen';
 import { post } from '../../requests';
-import { useAuth } from '../../hooks/useAuth';
 import { useFeed } from '../../hooks/APIClient';
 
 
 const useStyles = makeStyles(theme => ({
-  root: {
-    marginBottom: theme.spacing(4)
-  },
   images: {
     height: theme.spacing(50),
     display: 'flex'
@@ -34,7 +29,6 @@ const PollCreation: React.FC = () => {
   const classes = useStyles();
   const history = useHistory();
   const { enqueueSnackbar } = useSnackbar();
-  const { user } = useAuth();
   const { mutate: updateFeed } = useFeed();
   const {
     file: left,
@@ -71,31 +65,31 @@ const PollCreation: React.FC = () => {
   };
 
   return (
-    <Container maxWidth="sm" disableGutters>
-      <Card className={classes.root}>
-        {user && <UserStrip user={user} info="" />}
-        <Divider />
-        <div className={classes.images}>
-          <ImageInput callback={setLeft} progress={leftProgress} />
-          <ImageInput callback={setRight} progress={rightProgress} />
-        </div>
-        {
-          leftProgress || rightProgress
-            ? <LinearProgress color="primary" />
-            : (
-              <Button
-                color="primary"
-                disabled={!(left && right)}
-                variant="contained"
-                onClick={handleClick}
-                fullWidth
-              >
-                Submit
-              </Button>
-            )
-        }
-      </Card>
-    </Container>
+    <ModalScreen title="Create a poll">
+      <Container maxWidth="sm" disableGutters>
+        <Card>
+          <div className={classes.images}>
+            <ImageInput callback={setLeft} progress={leftProgress} />
+            <ImageInput callback={setRight} progress={rightProgress} />
+          </div>
+          {
+            leftProgress || rightProgress
+              ? <LinearProgress color="primary" />
+              : (
+                <Button
+                  color="primary"
+                  disabled={!(left && right)}
+                  variant="contained"
+                  onClick={handleClick}
+                  fullWidth
+                >
+                  Submit
+                </Button>
+              )
+          }
+        </Card>
+      </Container>
+    </ModalScreen>
   );
 };
 
-- 
cgit v1.2.3

