copyedit: username in bet list empty state
This commit is contained in:
parent
397d90c6b7
commit
749f7aad40
|
@ -101,7 +101,7 @@ export function BetsList(props: { user: User; hideBetsBefore?: number }) {
|
||||||
return <LoadingIndicator />
|
return <LoadingIndicator />
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bets.length === 0) return <NoBets />
|
if (bets.length === 0) return <NoBets user={user} />
|
||||||
// Decending creation time.
|
// Decending creation time.
|
||||||
bets.sort((bet1, bet2) => bet2.createdTime - bet1.createdTime)
|
bets.sort((bet1, bet2) => bet2.createdTime - bet1.createdTime)
|
||||||
const contractBets = groupBy(bets, 'contractId')
|
const contractBets = groupBy(bets, 'contractId')
|
||||||
|
@ -219,7 +219,7 @@ export function BetsList(props: { user: User; hideBetsBefore?: number }) {
|
||||||
|
|
||||||
<Col className="mt-6 divide-y">
|
<Col className="mt-6 divide-y">
|
||||||
{displayedContracts.length === 0 ? (
|
{displayedContracts.length === 0 ? (
|
||||||
<NoBets />
|
<NoBets user={user} />
|
||||||
) : (
|
) : (
|
||||||
displayedContracts.map((contract) => (
|
displayedContracts.map((contract) => (
|
||||||
<ContractBets
|
<ContractBets
|
||||||
|
@ -236,13 +236,20 @@ export function BetsList(props: { user: User; hideBetsBefore?: number }) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const NoBets = () => {
|
const NoBets = ({ user }: { user: User }) => {
|
||||||
|
const me = useUser()
|
||||||
return (
|
return (
|
||||||
<div className="mx-4 text-gray-500">
|
<div className="mx-4 text-gray-500">
|
||||||
|
{user.id === me?.id ? (
|
||||||
|
<>
|
||||||
You have not made any bets yet.{' '}
|
You have not made any bets yet.{' '}
|
||||||
<SiteLink href="/home" className="underline">
|
<SiteLink href="/home" className="underline">
|
||||||
Find a prediction market!
|
Find a prediction market!
|
||||||
</SiteLink>
|
</SiteLink>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>{user.name} has not made any public bets yet.</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user