diff --git a/web/components/user-page.tsx b/web/components/user-page.tsx index 48e7e20c..1ddee3d0 100644 --- a/web/components/user-page.tsx +++ b/web/components/user-page.tsx @@ -39,9 +39,6 @@ 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' -import { ShareIconButton } from 'web/components/share-icon-button' -import { ENV_CONFIG } from 'common/envs/constants' export function UserLink(props: { name: string @@ -122,7 +119,6 @@ export function UserPage(props: { user: User; currentUser?: User }) { const yourFollows = useFollows(currentUser?.id) const isFollowing = yourFollows?.includes(user.id) - const profit = user.profitCached.allTime const onFollow = () => { if (!currentUser) return @@ -187,17 +183,6 @@ export function UserPage(props: { user: User; currentUser?: User }) { {user.name} @{user.username} - - = 0 ? 'text-green-600' : 'text-red-400' - )} - > - {formatMoney(profit)} - {' '} - profit - @@ -303,23 +288,29 @@ export function UserPage(props: { user: User; currentUser?: User }) { ), }, - { - title: 'Bets', - content: ( -
- - -
- ), - tabIcon: {betCount}, - }, + ...(isCurrentUser + ? [ + { + title: 'Bets', + content: ( +
+ + +
+ ), + tabIcon: ( + {betCount} + ), + }, + ] + : []), ]} /> ) : ( diff --git a/web/pages/[username]/index.tsx b/web/pages/[username]/index.tsx index 22083c90..541041ed 100644 --- a/web/pages/[username]/index.tsx +++ b/web/pages/[username]/index.tsx @@ -13,6 +13,8 @@ export async function getStaticPropz(props: { params: { username: string } }) { const { username } = props.params const user = await getUserByUsername(username) + if (user) user.profitCached.allTime = 0 + return { props: { user,