From c9c3a95d2af1591b8d0d9af6d25cd170a337689f Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Thu, 18 Aug 2022 09:54:30 -0600 Subject: [PATCH] Condense user profile bits --- web/components/user-page.tsx | 65 ++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/web/components/user-page.tsx b/web/components/user-page.tsx index f412e38b..c8a697c3 100644 --- a/web/components/user-page.tsx +++ b/web/components/user-page.tsx @@ -58,8 +58,6 @@ export function UserLink(props: { ) } -export const TAB_IDS = ['markets', 'comments', 'bets', 'groups'] - export function UserPage(props: { user: User }) { const { user } = props const router = useRouter() @@ -103,10 +101,10 @@ export function UserPage(props: { user: User }) { {/* Top right buttons (e.g. edit, follow) */} -
+
{!isCurrentUser && } {isCurrentUser && ( - + {' '}
Edit
@@ -116,19 +114,22 @@ export function UserPage(props: { user: User }) { {/* Profile details: name, username, bio, and link to twitter/discord */} - {user.name} + + {user.name} + + = 0 ? 'text-green-600' : 'text-red-400' + )} + > + {formatMoney(profit)} + {' '} + profit + + @{user.username} - - = 0 ? 'text-green-600' : 'text-red-400' - )} - > - {formatMoney(profit)} - {' '} - profit - + {user.bio && ( <> @@ -138,17 +139,7 @@ export function UserPage(props: { user: User }) { )} - - - - - {currentUser && - ['ian', 'Austin', 'SG', 'JamesGrugett'].includes( - currentUser.username - ) && } - - - + {user.website && ( )} - + {currentUser?.id === user.id && ( - Refer a friend and earn {formatMoney(500)} when they sign up! + Earn {formatMoney(500)} when you refer a friend! {' '} You have @@ -244,6 +235,22 @@ export function UserPage(props: { user: User }) { ), }, + { + title: 'Social', + content: ( + + + + {currentUser && + ['ian', 'Austin', 'SG', 'JamesGrugett'].includes( + currentUser.username + ) && } + + + ), + }, ]} />