diff --git a/web/components/contract/contract-details.tsx b/web/components/contract/contract-details.tsx index 36a83f49..06aeeb10 100644 --- a/web/components/contract/contract-details.tsx +++ b/web/components/contract/contract-details.tsx @@ -27,11 +27,11 @@ import { contractMetrics } from 'common/contract-details' import { UserLink } from 'web/components/user-link' import { FeaturedContractBadge } from 'web/components/contract/featured-contract-badge' import { Tooltip } from 'web/components/tooltip' -import { useWindowSize } from 'web/hooks/use-window-size' import { ExtraContractActionsRow } from './extra-contract-actions-row' import { PlusCircleIcon } from '@heroicons/react/solid' import { GroupLink } from 'common/group' import { Subtitle } from '../subtitle' +import { useIsMobile } from 'web/hooks/use-is-mobile' export type ShowTime = 'resolve-date' | 'close-date' @@ -109,11 +109,6 @@ export function AvatarDetails(props: { ) } -export function useIsMobile() { - const { width } = useWindowSize() - return (width ?? 0) < 600 -} - export function ContractDetails(props: { contract: Contract disabled?: boolean diff --git a/web/components/contract/contract-tabs.tsx b/web/components/contract/contract-tabs.tsx index e4b95d97..e1ee141e 100644 --- a/web/components/contract/contract-tabs.tsx +++ b/web/components/contract/contract-tabs.tsx @@ -23,6 +23,7 @@ import { DEV_HOUSE_LIQUIDITY_PROVIDER_ID, HOUSE_LIQUIDITY_PROVIDER_ID, } from 'common/antes' +import { useIsMobile } from 'web/hooks/use-is-mobile' export function ContractTabs(props: { contract: Contract @@ -33,6 +34,7 @@ export function ContractTabs(props: { }) { const { contract, user, bets, tips } = props const { outcomeType } = contract + const isMobile = useIsMobile() const lps = useLiquidity(contract.id) @@ -131,7 +133,12 @@ export function ContractTabs(props: { }, ...(!user || !userBets?.length ? [] - : [{ title: `Your ${PAST_BETS}`, content: yourTrades }]), + : [ + { + title: isMobile ? `You` : `Your ${PAST_BETS}`, + content: yourTrades, + }, + ]), ]} /> {!user ? ( diff --git a/web/hooks/use-is-mobile.ts b/web/hooks/use-is-mobile.ts new file mode 100644 index 00000000..3bf2457a --- /dev/null +++ b/web/hooks/use-is-mobile.ts @@ -0,0 +1,6 @@ +import { useWindowSize } from 'web/hooks/use-window-size' + +export function useIsMobile() { + const { width } = useWindowSize() + return (width ?? 0) < 600 +} \ No newline at end of file