From cab8de5c6b246e1aa1376fa2b8666f09b44b6469 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Mon, 10 Aug 2020 11:12:06 +0300
Subject: refator: Feed -> PollList

---
 src/components/Feed/Feed.tsx | 63 --------------------------------------------
 1 file changed, 63 deletions(-)
 delete mode 100644 src/components/Feed/Feed.tsx

(limited to 'src/components/Feed/Feed.tsx')

diff --git a/src/components/Feed/Feed.tsx b/src/components/Feed/Feed.tsx
deleted file mode 100644
index bf3c5b7..0000000
--- a/src/components/Feed/Feed.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-import React from 'react';
-import { Poll } from 'which-types';
-import { WindowScroller, AutoSizer, List } from 'react-virtualized';
-import PollCard from '../PollCard/PollCard';
-
-
-interface PropTypes {
-  polls: Poll[];
-}
-
-interface RenderPropTypes {
-  index: number;
-  key: string;
-  style: React.CSSProperties;
-}
-
-
-const Feed: React.FC<PropTypes> = ({ polls }) => {
-  const RenderItem: React.FC<RenderPropTypes> = ({ index, style, key }) => {
-    const poll = polls[index];
-    return (
-      // To re-render on list resize, add this info to key
-      <div key={key + polls.length} style={style}>
-        <PollCard initialPoll={poll} />
-      </div>
-    );
-  };
-
-  return (
-    <WindowScroller>
-      {({
-        height,
-        isScrolling,
-        registerChild,
-        onChildScroll,
-        scrollTop
-      }) => (
-        <AutoSizer disableHeight>
-          {({ width }) => (
-            <div ref={registerChild}>
-              <List
-                autoHeight
-                height={height}
-                isScrolling={isScrolling}
-                onScroll={onChildScroll}
-                rowCount={polls.length}
-                rowHeight={550}
-                rowRenderer={RenderItem}
-                scrollTop={scrollTop}
-                width={width}
-                containerStyle={{ pointerEvents: 'auto' }}
-                overscanRowCount={1}
-              />
-            </div>
-          )}
-        </AutoSizer>
-      )}
-    </WindowScroller>
-  );
-};
-
-export default Feed;
-
-- 
cgit v1.2.3

