fix resolve prob notification text
This commit is contained in:
parent
d2471e2a02
commit
fde90be5a2
|
@ -971,13 +971,20 @@ function ContractResolvedNotification(props: {
|
||||||
const { sourceText, data } = notification
|
const { sourceText, data } = notification
|
||||||
const { userInvestment, userPayout } = (data as ContractResolutionData) ?? {}
|
const { userInvestment, userPayout } = (data as ContractResolutionData) ?? {}
|
||||||
const subtitle = 'resolved the market'
|
const subtitle = 'resolved the market'
|
||||||
|
|
||||||
const resolutionDescription = () => {
|
const resolutionDescription = () => {
|
||||||
if (!sourceText) return <div />
|
if (!sourceText) return <div />
|
||||||
|
|
||||||
if (sourceText === 'YES' || sourceText == 'NO') {
|
if (sourceText === 'YES' || sourceText == 'NO') {
|
||||||
return <BinaryOutcomeLabel outcome={sourceText as any} />
|
return <BinaryOutcomeLabel outcome={sourceText as any} />
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sourceText.includes('%'))
|
if (sourceText.includes('%'))
|
||||||
return <ProbPercentLabel prob={parseFloat(sourceText.replace('%', ''))} />
|
return (
|
||||||
|
<ProbPercentLabel
|
||||||
|
prob={parseFloat(sourceText.replace('%', '')) / 100}
|
||||||
|
/>
|
||||||
|
)
|
||||||
if (sourceText === 'CANCEL') return <CancelLabel />
|
if (sourceText === 'CANCEL') return <CancelLabel />
|
||||||
if (sourceText === 'MKT' || sourceText === 'PROB') return <MultiLabel />
|
if (sourceText === 'MKT' || sourceText === 'PROB') return <MultiLabel />
|
||||||
|
|
||||||
|
@ -996,7 +1003,7 @@ function ContractResolvedNotification(props: {
|
||||||
const description =
|
const description =
|
||||||
userInvestment && userPayout !== undefined ? (
|
userInvestment && userPayout !== undefined ? (
|
||||||
<Row className={'gap-1 '}>
|
<Row className={'gap-1 '}>
|
||||||
{resolutionDescription()}
|
Resolved: {resolutionDescription()}
|
||||||
Invested:
|
Invested:
|
||||||
<span className={'text-primary'}>{formatMoney(userInvestment)} </span>
|
<span className={'text-primary'}>{formatMoney(userInvestment)} </span>
|
||||||
Payout:
|
Payout:
|
||||||
|
@ -1013,7 +1020,7 @@ function ContractResolvedNotification(props: {
|
||||||
</span>
|
</span>
|
||||||
</Row>
|
</Row>
|
||||||
) : (
|
) : (
|
||||||
<span>{resolutionDescription()}</span>
|
<span>Resolved {resolutionDescription()}</span>
|
||||||
)
|
)
|
||||||
|
|
||||||
if (justSummary) {
|
if (justSummary) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user