From 61a424debfbfa98570e070fbf25d03aa9c56d679 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Sun, 14 Jun 2020 20:39:16 +0300
Subject: refactor: structurize pages

---
 src/pages/FeedPage/FeedPage.tsx | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 src/pages/FeedPage/FeedPage.tsx

(limited to 'src/pages/FeedPage/FeedPage.tsx')

diff --git a/src/pages/FeedPage/FeedPage.tsx b/src/pages/FeedPage/FeedPage.tsx
new file mode 100644
index 0000000..03bacfd
--- /dev/null
+++ b/src/pages/FeedPage/FeedPage.tsx
@@ -0,0 +1,19 @@
+import React, { useState, useEffect } from 'react';
+import { Poll } from '../../types';
+import Feed from '../../components/Feed/Feed';
+import { get } from '../../requests';
+
+const FeedPage: React.FC = () => {
+  const [polls, setPolls] = useState<Poll[]>([]);
+
+  useEffect(() => {
+    get('/polls').then(response => {
+      setPolls(response.data);
+    });
+  }, []);
+
+  return <Feed polls={polls} />;
+};
+
+export default FeedPage;
+
-- 
cgit v1.2.3

