diff options
author | eug-vs <eug-vs@keemail.me> | 2020-08-14 02:45:20 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-08-14 02:48:11 +0300 |
commit | fca54f49bb3541f726da1becffaa60197835ca68 (patch) | |
tree | 08dfa96410207f5621989c3cb0ea930624af1bee /src/containers/PollCreation/PollCreation.tsx | |
parent | 88d3c411efbf5f6ac74fa67e38c154f1e53d4938 (diff) | |
download | which-ui-fca54f49bb3541f726da1becffaa60197835ca68.tar.gz |
refactor: resolve eslint errors
Diffstat (limited to 'src/containers/PollCreation/PollCreation.tsx')
-rw-r--r-- | src/containers/PollCreation/PollCreation.tsx | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/src/containers/PollCreation/PollCreation.tsx b/src/containers/PollCreation/PollCreation.tsx index e350179..107314a 100644 --- a/src/containers/PollCreation/PollCreation.tsx +++ b/src/containers/PollCreation/PollCreation.tsx @@ -5,11 +5,12 @@ import { Button, Card, Divider, - Container + Container, + LinearProgress } from '@material-ui/core'; import { useSnackbar } from 'notistack'; -import PollCreationImage from './PollCreationImage'; +import ImageInput from './ImageInput'; import UserStrip from '../../components/UserStrip/UserStrip'; import { post } from '../../requests'; import { useAuth } from '../../hooks/useAuth'; @@ -73,18 +74,24 @@ const PollCreation: React.FC = () => { {user && <UserStrip user={user} info="" />} <Divider /> <div className={classes.images}> - <PollCreationImage callback={setLeft} progress={progressLeft} /> - <PollCreationImage callback={setRight} progress={progressRight} /> + <ImageInput callback={setLeft} progress={progressLeft} /> + <ImageInput callback={setRight} progress={progressRight} /> </div> - <Button - color="primary" - disabled={!(isLeftReady && isRightReady) || Boolean(progressLeft || progressRight)} - variant="contained" - onClick={handleClick} - fullWidth - > - {(progressLeft || progressRight) ? 'Waiting for upload' : 'Submit'} - </Button> + { + progressLeft || progressRight + ? <LinearProgress color="primary" /> + : ( + <Button + color="primary" + disabled={!(isLeftReady && isRightReady)} + variant="contained" + onClick={handleClick} + fullWidth + > + Submit + </Button> + ) + } </Card> </Container> ); |