Change winning value
This commit is contained in:
parent
1b1affe1d9
commit
c8586e7703
|
@ -148,13 +148,10 @@ function ClosedChallengeContent(props: {
|
||||||
setShowConfetti(true)
|
setShowConfetti(true)
|
||||||
}, [acceptances])
|
}, [acceptances])
|
||||||
const creatorWon = resolution === creatorsOutcome
|
const creatorWon = resolution === creatorsOutcome
|
||||||
const yourShares = (1 / (1 - creatorsOutcomeProb)) * amount
|
|
||||||
const creatorShares = (1 / creatorsOutcomeProb) * amount
|
|
||||||
const winningShares = creatorWon ? creatorShares : yourShares
|
|
||||||
|
|
||||||
if (!user) return <LoadingIndicator />
|
if (!user) return <LoadingIndicator />
|
||||||
|
|
||||||
const userWonCol = (user: User, amount: number) => (
|
const userWonCol = (user: User) => (
|
||||||
<Col className="w-full items-start justify-center gap-1 p-4">
|
<Col className="w-full items-start justify-center gap-1 p-4">
|
||||||
<Row className={'mb-2 w-full items-center justify-center gap-2'}>
|
<Row className={'mb-2 w-full items-center justify-center gap-2'}>
|
||||||
<span className={'mx-2 text-3xl'}>🥇</span>
|
<span className={'mx-2 text-3xl'}>🥇</span>
|
||||||
|
@ -245,7 +242,7 @@ function ClosedChallengeContent(props: {
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Row className={'mt-4 w-full'}>
|
<Row className={'mt-4 w-full'}>
|
||||||
{userWonCol(creatorWon ? creator : user, winningShares)}
|
{userWonCol(creatorWon ? creator : user)}
|
||||||
</Row>
|
</Row>
|
||||||
<Row className={'mt-4'}>
|
<Row className={'mt-4'}>
|
||||||
{userLostCol(creatorWon ? user : creator)}
|
{userLostCol(creatorWon ? user : creator)}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user