update close position modal button text
This commit is contained in:
parent
04904203b0
commit
f6ad6fbc56
|
@ -13,7 +13,6 @@ interface MarketCloseModalProps {
|
|||
isOpen: boolean
|
||||
market: PerpMarket
|
||||
marketName: string
|
||||
pnl: number
|
||||
side: string
|
||||
size: number
|
||||
}
|
||||
|
@ -23,7 +22,6 @@ const MarketCloseModal: FunctionComponent<MarketCloseModalProps> = ({
|
|||
isOpen,
|
||||
market,
|
||||
marketName,
|
||||
pnl,
|
||||
side,
|
||||
size,
|
||||
}) => {
|
||||
|
@ -108,11 +106,7 @@ const MarketCloseModal: FunctionComponent<MarketCloseModalProps> = ({
|
|||
</div>
|
||||
<div className="flex items-center">
|
||||
<Button onClick={() => handleMarketClose(side, size)}>
|
||||
{submitting ? (
|
||||
<Loading />
|
||||
) : (
|
||||
<span>{pnl <= 0 ? 'Dump It' : 'Cash In'}</span>
|
||||
)}
|
||||
{submitting ? <Loading /> : <span>Close Position</span>}
|
||||
</Button>
|
||||
<LinkButton className="ml-4 text-th-fgd-1" onClick={onClose}>
|
||||
Cancel
|
||||
|
|
|
@ -281,16 +281,6 @@ export default function MarketPosition() {
|
|||
onClose={handleCloseWarning}
|
||||
market={selectedMarket}
|
||||
marketName={marketName}
|
||||
pnl={
|
||||
+nativeI80F48ToUi(
|
||||
perpAccount.getPnl(
|
||||
mangoGroup.perpMarkets[marketIndex],
|
||||
mangoGroupCache.perpMarketCache[marketIndex],
|
||||
mangoGroupCache.priceCache[marketIndex].price
|
||||
),
|
||||
marketConfig.quoteDecimals
|
||||
)
|
||||
}
|
||||
side={perpAccount.basePosition.gt(ZERO_BN) ? 'sell' : 'buy'}
|
||||
size={Math.abs(
|
||||
selectedMarket.baseLotsToNumber(perpAccount.basePosition)
|
||||
|
|
|
@ -320,16 +320,6 @@ const PositionsTable = () => {
|
|||
onClose={handleCloseWarning}
|
||||
market={perpMarket}
|
||||
marketName={marketConfig.name}
|
||||
pnl={
|
||||
+nativeI80F48ToUi(
|
||||
perpAccount.getPnl(
|
||||
perpMarketInfo,
|
||||
perpMarketCache,
|
||||
price
|
||||
),
|
||||
marketConfig.quoteDecimals
|
||||
)
|
||||
}
|
||||
side={
|
||||
perpAccount.basePosition.gt(ZERO_BN)
|
||||
? 'sell'
|
||||
|
|
Loading…
Reference in New Issue