From af6552958fd669b6ac7573faa149173d0bddce65 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Tue, 19 Jul 2022 16:05:49 -0500 Subject: [PATCH] Show all-time profit on UserPage --- web/components/user-page.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/web/components/user-page.tsx b/web/components/user-page.tsx index 38efe345..09c28920 100644 --- a/web/components/user-page.tsx +++ b/web/components/user-page.tsx @@ -39,6 +39,7 @@ import { PortfolioValueSection } from './portfolio/portfolio-value-section' import { filterDefined } from 'common/util/array' import { useUserBets } from 'web/hooks/use-user-bets' import { ReferralsButton } from 'web/components/referrals-button' +import { formatMoney } from 'common/util/format' export function UserLink(props: { name: string @@ -123,6 +124,7 @@ export function UserPage(props: { const yourFollows = useFollows(currentUser?.id) const isFollowing = yourFollows?.includes(user.id) + const profit = user.profitCached.allTime const onFollow = () => { if (!currentUser) return @@ -187,6 +189,17 @@ export function UserPage(props: { {user.name} @{user.username} + + = 0 ? 'text-green-600' : 'text-red-400' + )} + > + {formatMoney(profit)} + {' '} + profit +