diff options
Diffstat (limited to 'src/pages/FeedPage/FeedPage.tsx')
-rw-r--r-- | src/pages/FeedPage/FeedPage.tsx | 19 |
1 files changed, 19 insertions, 0 deletions
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; + |