Just put 'you' on mobile
This commit is contained in:
parent
a2d912bb5a
commit
68f2277def
|
@ -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
|
||||||
|
|
|
@ -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 ? (
|
||||||
|
|
6
web/hooks/use-is-mobile.ts
Normal file
6
web/hooks/use-is-mobile.ts
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import { useWindowSize } from 'web/hooks/use-window-size'
|
||||||
|
|
||||||
|
export function useIsMobile() {
|
||||||
|
const { width } = useWindowSize()
|
||||||
|
return (width ?? 0) < 600
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user