aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorilyayudovin <ilyayudovin123@gmail.com>2020-09-19 01:22:20 +0300
committereug-vs <eug-vs@keemail.me>2020-10-08 22:06:50 +0300
commit2a8d307b53b1b7fa5962e73b5e506c7466b79a7e (patch)
tree40f3e44a3a88614a9eda66fdae445f5c9dc3ae7b
parent3aa75f9454332342fdb76d3b8466ef52f058cf4d (diff)
downloadwhich-ui-2a8d307b53b1b7fa5962e73b5e506c7466b79a7e.tar.gz
fix eslint errors
-rw-r--r--src/components/PollsList/PollsList.tsx8
-rw-r--r--src/components/PollsList/RenderItem.tsx4
-rw-r--r--src/containers/PollCreation/PollCreation.tsx7
3 files changed, 10 insertions, 9 deletions
diff --git a/src/components/PollsList/PollsList.tsx b/src/components/PollsList/PollsList.tsx
index 3eeed2b..1ad7763 100644
--- a/src/components/PollsList/PollsList.tsx
+++ b/src/components/PollsList/PollsList.tsx
@@ -1,4 +1,4 @@
-import React, {useCallback, useState, useMemo, useRef, useEffect} from 'react';
+import React, { useCallback, useState, useMemo, useEffect } from 'react';
import {
WindowScroller,
AutoSizer,
@@ -17,7 +17,7 @@ interface PropTypes {
}
const cache = new CellMeasurerCache({
- fixedWidth: true,
+ fixedWidth: true
});
const PAGE_SIZE = 10;
@@ -25,9 +25,9 @@ const PAGE_SIZE = 10;
const PollsList: React.FC<PropTypes> = ({ polls, mutate }) => {
const [displayCount, setDisplayCount] = useState<number>(PAGE_SIZE);
- useEffect(()=> {
+ useEffect(() => {
cache.clearAll();
- },[polls]);
+ }, [polls]);
const rowRenderer = useCallback(({ index, style, key, parent }) => (
<RenderItem
diff --git a/src/components/PollsList/RenderItem.tsx b/src/components/PollsList/RenderItem.tsx
index fcac20c..6a99167 100644
--- a/src/components/PollsList/RenderItem.tsx
+++ b/src/components/PollsList/RenderItem.tsx
@@ -1,7 +1,7 @@
import React, { useCallback } from 'react';
import { Poll } from 'which-types';
-import PollCard from '../PollCard/PollCard';
import { CellMeasurer, CellMeasurerCache, List } from 'react-virtualized';
+import PollCard from '../PollCard/PollCard';
interface PropTypes {
@@ -43,7 +43,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}`} style={{ ...style, paddingBottom: '20px' }}>
<PollCard poll={poll} setPoll={setPoll} />
</div>
</CellMeasurer>
diff --git a/src/containers/PollCreation/PollCreation.tsx b/src/containers/PollCreation/PollCreation.tsx
index 05a1966..2fef64f 100644
--- a/src/containers/PollCreation/PollCreation.tsx
+++ b/src/containers/PollCreation/PollCreation.tsx
@@ -1,4 +1,4 @@
-import React, { useState } from 'react';
+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';
@@ -50,7 +50,7 @@ const PollCreation: React.FC = () => {
progress: rightProgress
} = useS3Preupload();
- const handleDescriptionChange = (e: any) => {
+ const handleDescriptionChange = (e: ChangeEvent<HTMLTextAreaElement|HTMLInputElement>) => {
setDescription(e.target.value);
};
@@ -86,8 +86,9 @@ const PollCreation: React.FC = () => {
<TextField
multiline
rows={2}
- placeholder="Add a description"
fullWidth
+ placeholder="Add a description"
+ onChange={handleDescriptionChange}
InputProps={{
className: classes.descriptionText,
}}