From 0930745ca23f881c97a3cf641c913466c692af64 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Thu, 8 Oct 2020 22:43:13 +0300
Subject: feat: increase spacing between polls

---
 src/components/PollsList/RenderItem.tsx | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'src/components/PollsList/RenderItem.tsx')

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>
-- 
cgit v1.2.3

