-
{contract.mechanism === 'cpmm-1' && limitBets.length > 0 && (
- <>
-
-
- {!isCpmm && (
-
-
- Invested
-
- {formatMoney(invested)}
-
- )}
- {resolution ? (
-
- Payout
-
- {formatMoney(payout)}{' '}
-
-
-
- ) : (
- <>
- {isBinary ? (
- <>
-
-
- Payout if
-
-
- {formatMoney(yesWinnings)}
-
-
-
-
- Payout if
-
-
- {formatMoney(noWinnings)}
-
-
- >
- ) : isPseudoNumeric ? (
- <>
-
-
- Payout if {'>='} {formatLargeNumber(contract.max)}
-
-
- {formatMoney(yesWinnings)}
-
-
-
-
- Payout if {'<='} {formatLargeNumber(contract.min)}
-
-
- {formatMoney(noWinnings)}
-
-
- >
- ) : (
-
-
- Current value
-
- {formatMoney(payout)}
-
- )}
- >
- )}
+ {!isCpmm && (
- Profit
+
+ Invested
+
+ {formatMoney(invested)}
+
+ )}
+ {resolution ? (
+
+ Payout
- {formatMoney(profit)}
- {isYourBets &&
- isCpmm &&
- (isBinary || isPseudoNumeric) &&
- !isClosed &&
- !resolution &&
- hasShares &&
- sharesOutcome &&
- user && (
- <>
-
- {showSellModal && (
-
- )}
- >
- )}
+ {formatMoney(payout)}
-
+ ) : isBinary ? (
+ <>
+
+
+ Payout if
+
+ {formatMoney(yesWinnings)}
+
+
+
+ Payout if
+
+ {formatMoney(noWinnings)}
+
+ >
+ ) : isPseudoNumeric ? (
+ <>
+
+
+ Payout if {'>='} {formatLargeNumber(contract.max)}
+
+ {formatMoney(yesWinnings)}
+
+
+
+ Payout if {'<='} {formatLargeNumber(contract.min)}
+
+ {formatMoney(noWinnings)}
+
+ >
+ ) : (
+
+
+ Current value
+
+ {formatMoney(payout)}
+
+ )}
+ )
+
+ Profit
+
+ {formatMoney(profit)}
+ {isYourBets &&
+ isCpmm &&
+ (isBinary || isPseudoNumeric) &&
+ !isClosed &&
+ !resolution &&
+ hasShares &&
+ sharesOutcome &&
+ user && (
+ <>
+
+ {showSellModal && (
+
+ )}
+ >
+ )}
+
+
)
}
@@ -787,8 +761,8 @@ function SellButton(props: { contract: Contract; bet: Bet }) {
)
}
-function ProfitBadge(props: { profitPercent: number }) {
- const { profitPercent } = props
+function ProfitBadge(props: { profitPercent: number; className?: string }) {
+ const { profitPercent, className } = props
if (!profitPercent) return null
const colors =
profitPercent > 0
@@ -799,7 +773,8 @@ function ProfitBadge(props: { profitPercent: number }) {
{(profitPercent > 0 ? '+' : '') + profitPercent.toFixed(1) + '%'}