diff options
author | eug-vs <eug-vs@keemail.me> | 2020-10-08 22:43:13 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-10-08 23:45:01 +0300 |
commit | 0930745ca23f881c97a3cf641c913466c692af64 (patch) | |
tree | 97733a1c47448724ec5ee3bb13bdb8fd9f44e236 | |
parent | 2a8d307b53b1b7fa5962e73b5e506c7466b79a7e (diff) | |
download | which-ui-0930745ca23f881c97a3cf641c913466c692af64.tar.gz |
feat: increase spacing between polls
-rw-r--r-- | src/components/PollsList/RenderItem.tsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/components/PollsList/RenderItem.tsx b/src/components/PollsList/RenderItem.tsx index 6a99167..28411ec 100644 --- a/src/components/PollsList/RenderItem.tsx +++ b/src/components/PollsList/RenderItem.tsx @@ -1,4 +1,5 @@ import React, { useCallback } from 'react'; +import { makeStyles } from '@material-ui/core/styles'; import { Poll } from 'which-types'; import { CellMeasurer, CellMeasurerCache, List } from 'react-virtualized'; import PollCard from '../PollCard/PollCard'; @@ -14,6 +15,12 @@ interface PropTypes { _key: string; // https://reactjs.org/warnings/special-props.html } +const useStyles = makeStyles(theme => ({ + root: { + paddingBottom: theme.spacing(8) + } +})); + const compareProps = (oldProps: PropTypes, newProps: PropTypes) => { if (oldProps._key !== newProps._key) return false; if (oldProps.index !== newProps.index) return false; @@ -26,6 +33,7 @@ const compareProps = (oldProps: PropTypes, newProps: PropTypes) => { const RenderItem: React.FC<PropTypes> = React.memo(({ polls, mutate, index, style, cache, parent, _key }) => { + const classes = useStyles(); const poll = polls[index]; const setPoll = useCallback((newPoll: Poll) => { const newPolls = [...polls]; @@ -43,7 +51,7 @@ const RenderItem: React.FC<PropTypes> = React.memo(({ rowIndex={index} parent={parent} > - <div key={`${_key}-${poll._id}`} style={{ ...style, paddingBottom: '20px' }}> + <div key={`${_key}-${poll._id}`} className={classes.root} style={style}> <PollCard poll={poll} setPoll={setPoll} /> </div> </CellMeasurer> |