Hide profit from user page
This commit is contained in:
parent
9cc1a5199b
commit
3878b08d77
|
@ -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 }) {
|
|||
<Col className="mx-4 -mt-6">
|
||||
<span className="text-2xl font-bold">{user.name}</span>
|
||||
<span className="text-gray-500">@{user.username}</span>
|
||||
<span className="text-gray-500">
|
||||
<span
|
||||
className={clsx(
|
||||
'text-md',
|
||||
profit >= 0 ? 'text-green-600' : 'text-red-400'
|
||||
)}
|
||||
>
|
||||
{formatMoney(profit)}
|
||||
</span>{' '}
|
||||
profit
|
||||
</span>
|
||||
|
||||
<Spacer h={4} />
|
||||
|
||||
|
@ -303,6 +288,8 @@ export function UserPage(props: { user: User; currentUser?: User }) {
|
|||
</span>
|
||||
),
|
||||
},
|
||||
...(isCurrentUser
|
||||
? [
|
||||
{
|
||||
title: 'Bets',
|
||||
content: (
|
||||
|
@ -318,8 +305,12 @@ export function UserPage(props: { user: User; currentUser?: User }) {
|
|||
/>
|
||||
</div>
|
||||
),
|
||||
tabIcon: <span className="px-0.5 font-bold">{betCount}</span>,
|
||||
tabIcon: (
|
||||
<span className="px-0.5 font-bold">{betCount}</span>
|
||||
),
|
||||
},
|
||||
]
|
||||
: []),
|
||||
]}
|
||||
/>
|
||||
) : (
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user