update close position modal button text

This commit is contained in:
saml33 2021-08-25 20:26:59 +10:00 committed by Tyler Shipe
parent 04904203b0
commit f6ad6fbc56
3 changed files with 1 additions and 27 deletions

View File

@ -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

View File

@ -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)

View File

@ -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'