diff --git a/web/components/bets-list.tsx b/web/components/bets-list.tsx index 9ec28b14..0bcb3a61 100644 --- a/web/components/bets-list.tsx +++ b/web/components/bets-list.tsx @@ -52,9 +52,12 @@ import { NumericContract } from 'common/contract' type BetSort = 'newest' | 'profit' | 'closeTime' | 'value' type BetFilter = 'open' | 'sold' | 'closed' | 'resolved' | 'all' -export function BetsList(props: { user: User }) { - const { user } = props - const bets = useUserBets(user.id, { includeRedemptions: true }) +export function BetsList(props: { user: User; hideBetsBefore?: number }) { + const { user, hideBetsBefore } = props + let bets = useUserBets(user.id, { includeRedemptions: true }) + // Hide bets before 06-01-2022 if this isn't your own profile + // NOTE: This means profits shown are only starting 06-01-2022 as well. + bets = (bets ?? []).filter((bet) => bet.createdTime >= (hideBetsBefore ?? 0)) const [contracts, setContracts] = useState() const [sort, setSort] = useState('newest') diff --git a/web/components/user-page.tsx b/web/components/user-page.tsx index e1398fea..c1099ce8 100644 --- a/web/components/user-page.tsx +++ b/web/components/user-page.tsx @@ -44,6 +44,7 @@ export function UserLink(props: { } export const TAB_IDS = ['markets', 'comments', 'bets'] +const JUNE_1_2022 = new Date('2022-06-01T00:00:00.000Z').valueOf() export function UserPage(props: { user: User @@ -229,14 +230,27 @@ export function UserPage(props: { title: 'Bets', content: (
- + )} + - {isCurrentUser && } + {!isCurrentUser && ( + <> + + + + )}
), tabIcon: (