Show the current % instead of "MKT" in Your Trades
This commit is contained in:
parent
e4f1fbde3f
commit
0e640bf53b
|
@ -23,13 +23,15 @@ import {
|
||||||
import { Row } from './layout/row'
|
import { Row } from './layout/row'
|
||||||
import { UserLink } from './user-page'
|
import { UserLink } from './user-page'
|
||||||
import {
|
import {
|
||||||
|
calculateCancelPayout,
|
||||||
calculatePayout,
|
calculatePayout,
|
||||||
calculateSaleAmount,
|
calculateSaleAmount,
|
||||||
|
getProbability,
|
||||||
resolvedPayout,
|
resolvedPayout,
|
||||||
} from '../../common/calculate'
|
} from '../../common/calculate'
|
||||||
import { sellBet } from '../lib/firebase/api-call'
|
import { sellBet } from '../lib/firebase/api-call'
|
||||||
import { ConfirmationButton } from './confirmation-button'
|
import { ConfirmationButton } from './confirmation-button'
|
||||||
import { OutcomeLabel, YesLabel, NoLabel, MarketLabel } from './outcome-label'
|
import { OutcomeLabel, YesLabel, NoLabel } from './outcome-label'
|
||||||
|
|
||||||
type BetSort = 'newest' | 'profit'
|
type BetSort = 'newest' | 'profit'
|
||||||
|
|
||||||
|
@ -231,6 +233,7 @@ export function MyBetsSummary(props: {
|
||||||
}) {
|
}) {
|
||||||
const { bets, contract, showMKT, className } = props
|
const { bets, contract, showMKT, className } = props
|
||||||
const { resolution } = contract
|
const { resolution } = contract
|
||||||
|
calculateCancelPayout
|
||||||
|
|
||||||
const excludeSales = bets.filter((b) => !b.isSold && !b.sale)
|
const excludeSales = bets.filter((b) => !b.isSold && !b.sale)
|
||||||
const betsTotal = _.sumBy(excludeSales, (bet) => bet.amount)
|
const betsTotal = _.sumBy(excludeSales, (bet) => bet.amount)
|
||||||
|
@ -284,7 +287,10 @@ export function MyBetsSummary(props: {
|
||||||
{showMKT && (
|
{showMKT && (
|
||||||
<Col>
|
<Col>
|
||||||
<div className="whitespace-nowrap text-sm text-gray-500">
|
<div className="whitespace-nowrap text-sm text-gray-500">
|
||||||
Payout if <MarketLabel />
|
Payout at{' '}
|
||||||
|
<span className="text-blue-400">
|
||||||
|
{formatPercent(getProbability(contract.totalShares))}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="whitespace-nowrap">
|
<div className="whitespace-nowrap">
|
||||||
{formatMoney(marketWinnings)}
|
{formatMoney(marketWinnings)}
|
||||||
|
|
|
@ -21,10 +21,6 @@ export function CancelLabel() {
|
||||||
return <span className="text-yellow-400">N/A</span>
|
return <span className="text-yellow-400">N/A</span>
|
||||||
}
|
}
|
||||||
|
|
||||||
export function MarketLabel() {
|
|
||||||
return <span className="text-blue-400">MKT</span>
|
|
||||||
}
|
|
||||||
|
|
||||||
export function ProbLabel() {
|
export function ProbLabel() {
|
||||||
return <span className="text-blue-400">PROB</span>
|
return <span className="text-blue-400">PROB</span>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user