From 8c8e38f93dba84f67624959540cd2b2042dd5089 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 8 Oct 2020 23:31:08 +0300 Subject: feat: make PollCreation input same as description --- src/components/PollCard/PollCard.tsx | 4 ++-- src/containers/PollCreation/PollCreation.tsx | 32 +++++++++++++--------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/components/PollCard/PollCard.tsx b/src/components/PollCard/PollCard.tsx index eb025f2..6886534 100644 --- a/src/components/PollCard/PollCard.tsx +++ b/src/components/PollCard/PollCard.tsx @@ -44,7 +44,7 @@ const useStyles = makeStyles(theme => ({ transitionDuration: '0.5s' }, description: { - padding: theme.spacing(0.5, 2) + padding: theme.spacing(1, 2) } })); @@ -97,7 +97,7 @@ const PollCard: React.FC = React.memo(({ poll, setPoll }) => { {poll.description && ( - + {poll.description} )} diff --git a/src/containers/PollCreation/PollCreation.tsx b/src/containers/PollCreation/PollCreation.tsx index 2fef64f..33d95bb 100644 --- a/src/containers/PollCreation/PollCreation.tsx +++ b/src/containers/PollCreation/PollCreation.tsx @@ -1,7 +1,7 @@ import React, { ChangeEvent, useState } from 'react'; import Bluebird from 'bluebird'; import { makeStyles } from '@material-ui/core/styles'; -import { Card, Container, LinearProgress, Divider, TextField } from '@material-ui/core'; +import { Card, Container, LinearProgress, InputBase, Typography } from '@material-ui/core'; import SendIcon from '@material-ui/icons/Send'; import { useSnackbar } from 'notistack'; @@ -24,8 +24,8 @@ const useStyles = makeStyles(theme => ({ width: '100%', height: 100 }, - descriptionText: { - padding: 10 + description: { + padding: theme.spacing(1, 2) } })); @@ -77,28 +77,26 @@ const PollCreation: React.FC = () => { title="Create a poll" actionIcon={} handleAction={handleSubmit} - isActionDisabled={!(left && right) || leftProgress > 0 || rightProgress > 0} + isActionDisabled={!(left && right) || leftProgress + rightProgress > 0} > - {user && } - - + {user && } + + +
- {(leftProgress > 0 || rightProgress > 0) && ( + {(leftProgress + rightProgress > 0) && ( <>