diff options
Diffstat (limited to 'src/components/Feed/Feed.tsx')
-rw-r--r-- | src/components/Feed/Feed.tsx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/components/Feed/Feed.tsx b/src/components/Feed/Feed.tsx index 785dd79..c532f45 100644 --- a/src/components/Feed/Feed.tsx +++ b/src/components/Feed/Feed.tsx @@ -1,8 +1,9 @@ import React from 'react'; import { Poll } from 'which-types'; -import PollCard from '../PollCard/PollCard'; import { WindowScroller, AutoSizer, List } from 'react-virtualized'; +import PollCard from '../PollCard/PollCard'; + interface PropTypes { polls: Poll[]; } @@ -14,21 +15,26 @@ interface RenderPropTypes { } const Feed: React.FC<PropTypes> = ({ polls }) => { - const RenderItem: React.FC<RenderPropTypes> = ({ index, style, key }) => { const poll = polls[index]; return ( <div key={key} style={style}> <PollCard initialPoll={poll} /> </div> - ) + ); }; return ( <WindowScroller> - {({height, isScrolling, registerChild, onChildScroll, scrollTop}) => ( + {({ + height, + isScrolling, + registerChild, + onChildScroll, + scrollTop + }) => ( <AutoSizer disableHeight> - {({width}) => ( + {({ width }) => ( <div ref={registerChild}> <List autoHeight |