diff options
author | Eugene Sokolov <eug-vs@keemail.me> | 2020-10-09 00:30:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-09 00:30:59 +0300 |
commit | a5d0f3edcd5478c81262524cbfef8273a065df36 (patch) | |
tree | 48725733e1650fb11f59e4e8dd4f752950a26f72 /src/components/PollCard/PollCard.tsx | |
parent | bdb4d194307c9755c2083c1a11bb876abebcb6de (diff) | |
parent | 8e9245d18ba591e93dd7dd1de9a271d0b51941a7 (diff) | |
download | which-ui-a5d0f3edcd5478c81262524cbfef8273a065df36.tar.gz |
Merge pull request #103 from which-ecosystem/feat/description
Add description to Poll Model
Diffstat (limited to 'src/components/PollCard/PollCard.tsx')
-rw-r--r-- | src/components/PollCard/PollCard.tsx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/components/PollCard/PollCard.tsx b/src/components/PollCard/PollCard.tsx index 540679f..a06bad8 100644 --- a/src/components/PollCard/PollCard.tsx +++ b/src/components/PollCard/PollCard.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; -import { Card, CardActionArea } from '@material-ui/core/'; +import { Card, CardActionArea, Typography } from '@material-ui/core/'; import { Which, Poll } from 'which-types'; import { useSnackbar } from 'notistack'; @@ -42,6 +42,11 @@ const useStyles = makeStyles(theme => ({ height: theme.spacing(2), backgroundColor: theme.palette.primary.light, transitionDuration: '0.5s' + }, + description: { + padding: theme.spacing(1, 2), + wordWrap: 'break-word', + whiteSpace: 'pre-wrap' } })); @@ -93,6 +98,11 @@ const PollCard: React.FC<PropTypes> = React.memo(({ poll, setPoll }) => { return ( <Card elevation={3}> <UserStrip user={author} info={date} /> + {poll.description && ( + <Typography className={classes.description}> + {poll.description} + </Typography> + )} <div className={classes.media}> <CardActionArea onDoubleClick={handleVote('left')} className={classes.media}> <BackgroundImage src={left.url} /> |