diff options
Diffstat (limited to 'src/containers/ProfilePage')
-rw-r--r-- | src/containers/ProfilePage/ProfilePage.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/containers/ProfilePage/ProfilePage.tsx b/src/containers/ProfilePage/ProfilePage.tsx index db27d25..7a1d729 100644 --- a/src/containers/ProfilePage/ProfilePage.tsx +++ b/src/containers/ProfilePage/ProfilePage.tsx @@ -4,7 +4,7 @@ import { Poll } from 'which-types'; import { Container } from '@material-ui/core'; import ProfileInfo from './ProfileInfo'; -import Feed from '../../components/Feed/Feed'; +import PollsList from '../../components/PollsList/PollsList'; import Loading from '../../components/Loading/Loading'; import { useAuth } from '../../hooks/useAuth'; import { useUser, useProfile } from '../../hooks/APIClient'; @@ -16,7 +16,7 @@ const ProfilePage: React.FC = () => { const { user } = useAuth(); const { data: userInfo, mutate: setUserInfo } = useUser(username); - const { data: polls, isValidating } = useProfile(userInfo?._id); + const { data: polls, mutate: mutatePolls, isValidating } = useProfile(userInfo?._id); useEffect(() => { if (!username) { @@ -44,9 +44,10 @@ const ProfilePage: React.FC = () => { savedPolls={polls.length} totalVotes={totalVotes} /> - {!polls.length && isValidating + { + isValidating && !polls ? <Loading /> - : <Feed polls={polls} /> + : <PollsList polls={polls} mutate={mutatePolls} /> } </Container> ); |