aboutsummaryrefslogtreecommitdiff
path: root/src/containers
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2020-08-14 20:45:22 +0300
committerGitHub <noreply@github.com>2020-08-14 20:45:22 +0300
commit845eaf8d28fdd992faf0fba0dcafdc61ef53ef35 (patch)
treecc4e4065a9bae7e8e9d574ee6886080855975b24 /src/containers
parent9073af9512687e724a5237d55a85656abb3305e5 (diff)
parent21e5bf9ee3dc4f284c10f7915921e1e407b65b5a (diff)
downloadwhich-ui-845eaf8d28fdd992faf0fba0dcafdc61ef53ef35.tar.gz
Merge pull request #83 from which-ecosystem/better-ux
Crazy performance boost
Diffstat (limited to 'src/containers')
-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 />}