diff options
Diffstat (limited to 'src/pages/FeedPage/FeedPage.tsx')
-rw-r--r-- | src/pages/FeedPage/FeedPage.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pages/FeedPage/FeedPage.tsx b/src/pages/FeedPage/FeedPage.tsx index d29103a..0b7d44a 100644 --- a/src/pages/FeedPage/FeedPage.tsx +++ b/src/pages/FeedPage/FeedPage.tsx @@ -1,12 +1,12 @@ import React, { useState, useEffect } from 'react'; import { Poll } from 'which-types'; +import { Container } from '@material-ui/core/'; import Feed from '../../components/Feed/Feed'; import { get } from '../../requests'; import PollSubmission from './PollSubmission'; import { useAuth } from '../../hooks/useAuth'; - const FeedPage: React.FC = () => { const [polls, setPolls] = useState<Poll[]>([]); const { isAuthenticated } = useAuth(); @@ -19,15 +19,15 @@ const FeedPage: React.FC = () => { const addPoll = (poll: Poll): void => { polls.unshift(poll); - setPolls([...polls]); + setPolls([]); + setPolls(polls); }; - return ( - <> + <Container maxWidth="sm" disableGutters> {isAuthenticated() && <PollSubmission addPoll={addPoll} />} <Feed polls={polls} /> - </> + </Container> ); }; |