Remove contract. calls
This commit is contained in:
parent
e40780078c
commit
f055300b69
|
@ -80,7 +80,7 @@ export function MiscDetails(props: {
|
||||||
) : (contract?.featuredOnHomeRank ?? 0) > 0 ? (
|
) : (contract?.featuredOnHomeRank ?? 0) > 0 ? (
|
||||||
<FeaturedContractBadge />
|
<FeaturedContractBadge />
|
||||||
) : volume > 0 || !isNew ? (
|
) : volume > 0 || !isNew ? (
|
||||||
<Row className={'shrink-0'}>{formatMoney(contract.volume)} bet</Row>
|
<Row className={'shrink-0'}>{formatMoney(volume)} bet</Row>
|
||||||
) : (
|
) : (
|
||||||
<NewContractBadge />
|
<NewContractBadge />
|
||||||
)}
|
)}
|
||||||
|
@ -103,7 +103,7 @@ export function AvatarDetails(props: {
|
||||||
short?: boolean
|
short?: boolean
|
||||||
}) {
|
}) {
|
||||||
const { contract, short, className } = props
|
const { contract, short, className } = props
|
||||||
const { creatorName, creatorUsername } = contract
|
const { creatorName, creatorUsername, creatorAvatarUrl } = contract
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row
|
<Row
|
||||||
|
@ -111,7 +111,7 @@ export function AvatarDetails(props: {
|
||||||
>
|
>
|
||||||
<Avatar
|
<Avatar
|
||||||
username={creatorUsername}
|
username={creatorUsername}
|
||||||
avatarUrl={contract.creatorAvatarUrl}
|
avatarUrl={creatorAvatarUrl}
|
||||||
size={6}
|
size={6}
|
||||||
/>
|
/>
|
||||||
<UserLink name={creatorName} username={creatorUsername} short={short} />
|
<UserLink name={creatorName} username={creatorUsername} short={short} />
|
||||||
|
@ -146,8 +146,15 @@ export function ContractDetails(props: {
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
}) {
|
}) {
|
||||||
const { contract, isCreator, disabled } = props
|
const { contract, isCreator, disabled } = props
|
||||||
const { closeTime, creatorName, creatorUsername, creatorId, groupLinks } =
|
const {
|
||||||
contract
|
closeTime,
|
||||||
|
creatorName,
|
||||||
|
creatorUsername,
|
||||||
|
creatorId,
|
||||||
|
groupLinks,
|
||||||
|
creatorAvatarUrl,
|
||||||
|
resolutionTime,
|
||||||
|
} = contract
|
||||||
const { volumeLabel, resolvedDate } = contractMetrics(contract)
|
const { volumeLabel, resolvedDate } = contractMetrics(contract)
|
||||||
|
|
||||||
const groupToDisplay =
|
const groupToDisplay =
|
||||||
|
@ -171,7 +178,7 @@ export function ContractDetails(props: {
|
||||||
<Row className="items-center gap-2">
|
<Row className="items-center gap-2">
|
||||||
<Avatar
|
<Avatar
|
||||||
username={creatorUsername}
|
username={creatorUsername}
|
||||||
avatarUrl={contract.creatorAvatarUrl}
|
avatarUrl={creatorAvatarUrl}
|
||||||
noLink={disabled}
|
noLink={disabled}
|
||||||
size={6}
|
size={6}
|
||||||
/>
|
/>
|
||||||
|
@ -234,13 +241,10 @@ export function ContractDetails(props: {
|
||||||
|
|
||||||
{(!!closeTime || !!resolvedDate) && (
|
{(!!closeTime || !!resolvedDate) && (
|
||||||
<Row className="hidden items-center gap-1 md:inline-flex">
|
<Row className="hidden items-center gap-1 md:inline-flex">
|
||||||
{resolvedDate && contract.resolutionTime ? (
|
{resolvedDate && resolutionTime ? (
|
||||||
<>
|
<>
|
||||||
<ClockIcon className="h-5 w-5" />
|
<ClockIcon className="h-5 w-5" />
|
||||||
<DateTimeTooltip
|
<DateTimeTooltip text="Market resolved:" time={resolutionTime}>
|
||||||
text="Market resolved:"
|
|
||||||
time={contract.resolutionTime}
|
|
||||||
>
|
|
||||||
{resolvedDate}
|
{resolvedDate}
|
||||||
</DateTimeTooltip>
|
</DateTimeTooltip>
|
||||||
</>
|
</>
|
||||||
|
@ -282,9 +286,10 @@ export function ExtraMobileContractDetails(props: {
|
||||||
forceShowVolume?: boolean
|
forceShowVolume?: boolean
|
||||||
}) {
|
}) {
|
||||||
const { contract, user, forceShowVolume } = props
|
const { contract, user, forceShowVolume } = props
|
||||||
|
const { volume, resolutionTime, closeTime, creatorId } = contract
|
||||||
const { resolvedDate } = contractMetrics(contract)
|
const { resolvedDate } = contractMetrics(contract)
|
||||||
const volumeTranslation =
|
const volumeTranslation =
|
||||||
contract.volume > 800 ? 'High' : contract.volume > 300 ? 'Medium' : 'Low'
|
volume > 800 ? 'High' : volume > 300 ? 'Medium' : 'Low'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row
|
<Row
|
||||||
|
@ -293,13 +298,10 @@ export function ExtraMobileContractDetails(props: {
|
||||||
user ? 'w-full' : ''
|
user ? 'w-full' : ''
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{resolvedDate && contract.resolutionTime ? (
|
{resolvedDate && resolutionTime ? (
|
||||||
<Col className={'items-center text-sm'}>
|
<Col className={'items-center text-sm'}>
|
||||||
<Row className={'text-gray-500'}>
|
<Row className={'text-gray-500'}>
|
||||||
<DateTimeTooltip
|
<DateTimeTooltip text="Market resolved:" time={resolutionTime}>
|
||||||
text="Market resolved:"
|
|
||||||
time={contract.resolutionTime}
|
|
||||||
>
|
|
||||||
{resolvedDate}
|
{resolvedDate}
|
||||||
</DateTimeTooltip>
|
</DateTimeTooltip>
|
||||||
</Row>
|
</Row>
|
||||||
|
@ -307,12 +309,12 @@ export function ExtraMobileContractDetails(props: {
|
||||||
</Col>
|
</Col>
|
||||||
) : (
|
) : (
|
||||||
!resolvedDate &&
|
!resolvedDate &&
|
||||||
contract.closeTime && (
|
closeTime && (
|
||||||
<Col className={'items-center text-sm text-gray-500'}>
|
<Col className={'items-center text-sm text-gray-500'}>
|
||||||
<EditableCloseDate
|
<EditableCloseDate
|
||||||
closeTime={contract.closeTime}
|
closeTime={closeTime}
|
||||||
contract={contract}
|
contract={contract}
|
||||||
isCreator={contract.creatorId === user?.id}
|
isCreator={creatorId === user?.id}
|
||||||
/>
|
/>
|
||||||
<Row className={'text-gray-400'}>Ends</Row>
|
<Row className={'text-gray-400'}>Ends</Row>
|
||||||
</Col>
|
</Col>
|
||||||
|
@ -320,9 +322,7 @@ export function ExtraMobileContractDetails(props: {
|
||||||
)}
|
)}
|
||||||
{(user || forceShowVolume) && (
|
{(user || forceShowVolume) && (
|
||||||
<Col className={'items-center text-sm text-gray-500'}>
|
<Col className={'items-center text-sm text-gray-500'}>
|
||||||
<Tooltip text={formatMoney(contract.volume)}>
|
<Tooltip text={formatMoney(volume)}>{volumeTranslation}</Tooltip>
|
||||||
{volumeTranslation}
|
|
||||||
</Tooltip>
|
|
||||||
<Row className={'text-gray-400'}>Activity</Row>
|
<Row className={'text-gray-400'}>Activity</Row>
|
||||||
</Col>
|
</Col>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user