diff options
Diffstat (limited to 'src/containers/Profile/Profile.tsx')
-rw-r--r-- | src/containers/Profile/Profile.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/containers/Profile/Profile.tsx b/src/containers/Profile/Profile.tsx index fe77ff2..701aa06 100644 --- a/src/containers/Profile/Profile.tsx +++ b/src/containers/Profile/Profile.tsx @@ -27,6 +27,7 @@ const Profile: React.FC = () => { } }, [username, history, user]); + const isOwnProfile = useMemo(() => user?.username === username, [user, username]); const totalVotes = useMemo(() => polls?.reduce( (total: number, current: Poll) => { @@ -47,10 +48,10 @@ const Profile: React.FC = () => { polls ? polls.length ? <PollsList polls={polls} mutate={mutatePolls} /> - : <EmptyState /> + : <EmptyState message={isOwnProfile ? 'Create a poll and it will show up here.' : ''} /> : isValidating && <Loading /> } - {user?.username === username && <Fab />} + {isOwnProfile && <Fab />} </Container> ); }; |