diff options
Diffstat (limited to 'src/containers/Profile')
-rw-r--r-- | src/containers/Profile/Profile.tsx | 5 | ||||
-rw-r--r-- | src/containers/Profile/ProfileInfo.tsx | 2 |
2 files changed, 4 insertions, 3 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> ); }; diff --git a/src/containers/Profile/ProfileInfo.tsx b/src/containers/Profile/ProfileInfo.tsx index c5c5454..c9831f3 100644 --- a/src/containers/Profile/ProfileInfo.tsx +++ b/src/containers/Profile/ProfileInfo.tsx @@ -22,7 +22,7 @@ interface PropTypes { const useStyles = makeStyles(theme => ({ root: { position: 'relative', - marginBottom: theme.spacing(2) + marginBottom: theme.spacing(4) }, avatar: { width: 150, |