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 { filterDefined } from 'common/util/array'
|
||||||
import { useUserBets } from 'web/hooks/use-user-bets'
|
import { useUserBets } from 'web/hooks/use-user-bets'
|
||||||
import { ReferralsButton } from 'web/components/referrals-button'
|
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: {
|
export function UserLink(props: {
|
||||||
name: string
|
name: string
|
||||||
|
@ -122,7 +119,6 @@ export function UserPage(props: { user: User; currentUser?: User }) {
|
||||||
|
|
||||||
const yourFollows = useFollows(currentUser?.id)
|
const yourFollows = useFollows(currentUser?.id)
|
||||||
const isFollowing = yourFollows?.includes(user.id)
|
const isFollowing = yourFollows?.includes(user.id)
|
||||||
const profit = user.profitCached.allTime
|
|
||||||
|
|
||||||
const onFollow = () => {
|
const onFollow = () => {
|
||||||
if (!currentUser) return
|
if (!currentUser) return
|
||||||
|
@ -187,17 +183,6 @@ export function UserPage(props: { user: User; currentUser?: User }) {
|
||||||
<Col className="mx-4 -mt-6">
|
<Col className="mx-4 -mt-6">
|
||||||
<span className="text-2xl font-bold">{user.name}</span>
|
<span className="text-2xl font-bold">{user.name}</span>
|
||||||
<span className="text-gray-500">@{user.username}</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} />
|
<Spacer h={4} />
|
||||||
|
|
||||||
|
@ -303,6 +288,8 @@ export function UserPage(props: { user: User; currentUser?: User }) {
|
||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
...(isCurrentUser
|
||||||
|
? [
|
||||||
{
|
{
|
||||||
title: 'Bets',
|
title: 'Bets',
|
||||||
content: (
|
content: (
|
||||||
|
@ -318,8 +305,12 @@ export function UserPage(props: { user: User; currentUser?: User }) {
|
||||||
/>
|
/>
|
||||||
</div>
|
</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 { username } = props.params
|
||||||
const user = await getUserByUsername(username)
|
const user = await getUserByUsername(username)
|
||||||
|
|
||||||
|
if (user) user.profitCached.allTime = 0
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
user,
|
user,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user