aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/containers/Profile/Profile.tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/containers/Profile/Profile.tsx b/src/containers/Profile/Profile.tsx
index 701aa06..a46dbde 100644
--- a/src/containers/Profile/Profile.tsx
+++ b/src/containers/Profile/Profile.tsx
@@ -28,6 +28,11 @@ const Profile: React.FC = () => {
}, [username, history, user]);
const isOwnProfile = useMemo(() => user?.username === username, [user, username]);
+ const message = useMemo(() => {
+ return isOwnProfile
+ ? 'Create a poll and it will show up here.'
+ : 'This user has not uploaded anything yet.';
+ }, [isOwnProfile]);
const totalVotes = useMemo(() => polls?.reduce(
(total: number, current: Poll) => {
@@ -48,7 +53,7 @@ const Profile: React.FC = () => {
polls
? polls.length
? <PollsList polls={polls} mutate={mutatePolls} />
- : <EmptyState message={isOwnProfile ? 'Create a poll and it will show up here.' : ''} />
+ : <EmptyState message={message} />
: isValidating && <Loading />
}
{isOwnProfile && <Fab />}