Just put 'you' on mobile

This commit is contained in:
Ian Philips 2022-09-16 09:28:39 -06:00
parent a2d912bb5a
commit 68f2277def
3 changed files with 15 additions and 7 deletions

View File

@ -27,11 +27,11 @@ import { contractMetrics } from 'common/contract-details'
import { UserLink } from 'web/components/user-link' import { UserLink } from 'web/components/user-link'
import { FeaturedContractBadge } from 'web/components/contract/featured-contract-badge' import { FeaturedContractBadge } from 'web/components/contract/featured-contract-badge'
import { Tooltip } from 'web/components/tooltip' import { Tooltip } from 'web/components/tooltip'
import { useWindowSize } from 'web/hooks/use-window-size'
import { ExtraContractActionsRow } from './extra-contract-actions-row' import { ExtraContractActionsRow } from './extra-contract-actions-row'
import { PlusCircleIcon } from '@heroicons/react/solid' import { PlusCircleIcon } from '@heroicons/react/solid'
import { GroupLink } from 'common/group' import { GroupLink } from 'common/group'
import { Subtitle } from '../subtitle' import { Subtitle } from '../subtitle'
import { useIsMobile } from 'web/hooks/use-is-mobile'
export type ShowTime = 'resolve-date' | 'close-date' 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: { export function ContractDetails(props: {
contract: Contract contract: Contract
disabled?: boolean disabled?: boolean

View File

@ -23,6 +23,7 @@ import {
DEV_HOUSE_LIQUIDITY_PROVIDER_ID, DEV_HOUSE_LIQUIDITY_PROVIDER_ID,
HOUSE_LIQUIDITY_PROVIDER_ID, HOUSE_LIQUIDITY_PROVIDER_ID,
} from 'common/antes' } from 'common/antes'
import { useIsMobile } from 'web/hooks/use-is-mobile'
export function ContractTabs(props: { export function ContractTabs(props: {
contract: Contract contract: Contract
@ -33,6 +34,7 @@ export function ContractTabs(props: {
}) { }) {
const { contract, user, bets, tips } = props const { contract, user, bets, tips } = props
const { outcomeType } = contract const { outcomeType } = contract
const isMobile = useIsMobile()
const lps = useLiquidity(contract.id) const lps = useLiquidity(contract.id)
@ -131,7 +133,12 @@ export function ContractTabs(props: {
}, },
...(!user || !userBets?.length ...(!user || !userBets?.length
? [] ? []
: [{ title: `Your ${PAST_BETS}`, content: yourTrades }]), : [
{
title: isMobile ? `You` : `Your ${PAST_BETS}`,
content: yourTrades,
},
]),
]} ]}
/> />
{!user ? ( {!user ? (

View File

@ -0,0 +1,6 @@
import { useWindowSize } from 'web/hooks/use-window-size'
export function useIsMobile() {
const { width } = useWindowSize()
return (width ?? 0) < 600
}