From 52799ec4e4cd5801423ee0d2aa56039c061afdb4 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 13 Aug 2020 17:24:09 +0300 Subject: feat!: remove expansion from PollCreation --- src/containers/PollCreation/PollCreation.tsx | 48 +++++++++++----------------- 1 file changed, 18 insertions(+), 30 deletions(-) (limited to 'src/containers/PollCreation') diff --git a/src/containers/PollCreation/PollCreation.tsx b/src/containers/PollCreation/PollCreation.tsx index 1f3a802..7501d3a 100644 --- a/src/containers/PollCreation/PollCreation.tsx +++ b/src/containers/PollCreation/PollCreation.tsx @@ -1,10 +1,8 @@ import React, { useState } from 'react'; import { makeStyles } from '@material-ui/core/styles'; -import Collapse from '@material-ui/core/Collapse'; import { Button, Card, - ClickAwayListener, Divider, Container } from '@material-ui/core'; @@ -33,7 +31,6 @@ const useStyles = makeStyles(theme => ({ const PollCreation: React.FC = ({ addPoll }) => { const classes = useStyles(); - const [expanded, setExpanded] = useState(true); const [left, setLeft] = useState(); const [right, setRight] = useState(); const { enqueueSnackbar } = useSnackbar(); @@ -41,10 +38,6 @@ const PollCreation: React.FC = ({ addPoll }) => { const readyToSubmit = left && right; - const handleClickAway = () => { - setExpanded(false); - }; - const uploadImage = (file?: File) => { const headers = { 'Content-Type': 'image/png' }; return get('/files') @@ -57,7 +50,7 @@ const PollCreation: React.FC = ({ addPoll }) => { }; const handleClick = async () => { - if (expanded && readyToSubmit) { + if (readyToSubmit) { const [leftUrl, rightUrl] = await Promise.all([uploadImage(left), uploadImage(right)]); const contents = { @@ -72,32 +65,27 @@ const PollCreation: React.FC = ({ addPoll }) => { }); }); } - setExpanded(!expanded); }; return ( - - - - {user && } - -
- - -
-
- -
-
+ + {user && } + +
+ + +
+ +
); }; -- cgit v1.2.3