From a892a231fe433d3a9722d3ef4c5ded035fcf469d Mon Sep 17 00:00:00 2001 From: arealclimber Date: Tue, 22 Aug 2023 15:55:53 +0800 Subject: [PATCH 1/5] =?UTF-8?q?fix:=20=F0=9F=90=9B=20pnl=20approximately-e?= =?UTF-8?q?qual-to=20symbol=20#1146=20rm=20input=20radius?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #1143 #1146 --- package.json | 2 +- .../open_position_item/open_position_item.tsx | 4 +++- .../position_closed_modal.tsx | 15 +++++++++------ src/components/trading_input/trading_input.tsx | 5 +---- .../update_form_modal/update_form_modal.tsx | 2 ++ src/lib/common.ts | 11 +++++++---- 6 files changed, 23 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index cf0533191..074cf7fd1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "src", - "version": "0.8.0+39.3", + "version": "0.8.0+41.1", "private": true, "scripts": { "dev": "next dev", diff --git a/src/components/open_position_item/open_position_item.tsx b/src/components/open_position_item/open_position_item.tsx index 3ee92369d..2a8231abc 100644 --- a/src/components/open_position_item/open_position_item.tsx +++ b/src/components/open_position_item/open_position_item.tsx @@ -247,12 +247,14 @@ const OpenPositionItem = ({openCfdDetails}: IOpenPositionItemProps) => { const displayedCrossStyle = 'before:absolute before:left-1 before:top-10px before:z-40 before:block before:h-1 before:w-5 before:rotate-45 before:rounded-md after:absolute after:left-1 after:top-10px after:z-40 after:block after:h-1 after:w-5 after:-rotate-45 after:rounded-md'; - const displayedPnLSymbol = !!!marketCtx.selectedTicker?.price + const displayedPnLSymbol = !marketCtx.selectedTicker?.price ? '' : pnl?.value > 0 ? '+' : pnl?.value < 0 ? '-' + : openPrice !== closePrice && Math.abs(pnl?.value ?? 0) === 0 + ? '≈' : ''; const displayedPnLValue = !!!marketCtx.selectedTicker?.price diff --git a/src/components/position_closed_modal/position_closed_modal.tsx b/src/components/position_closed_modal/position_closed_modal.tsx index f2034a12e..3be6992cb 100644 --- a/src/components/position_closed_modal/position_closed_modal.tsx +++ b/src/components/position_closed_modal/position_closed_modal.tsx @@ -55,6 +55,7 @@ import {ToastTypeAndText} from '../../constants/toast_type'; import {ToastId} from '../../constants/toast_id'; import {CustomError, isCustomError} from '../../lib/custom_error'; import SafeMath from '../../lib/safe_math'; +import {open} from 'fs/promises'; type TranslateFunction = (s: string) => string; interface IPositionClosedModal { @@ -103,12 +104,17 @@ const PositionClosedModal = ({ const displayedGuaranteedStopSetting = !!openCfdDetails?.guaranteedStop ? 'Yes' : 'No'; - const displayedPnLSymbol = !!openCfdDetails.pnl - ? openCfdDetails?.pnl?.value > 0 + const displayedPnLSymbol = !!openCfdDetails.pnl?.value + ? (openCfdDetails.pnl as IPnL).value > 0 ? '+' - : openCfdDetails?.pnl?.value < 0 + : (openCfdDetails.pnl as IPnL).value < 0 ? '-' : '' + : openCfdDetails.pnl !== undefined && Math.abs((openCfdDetails.pnl as IPnL).value) === 0 + ? openCfdDetails.openPrice !== openCfdDetails.closePrice || + openCfdDetails.openPrice !== gQuotationRef.current.price + ? '≈' + : '' : ''; const displayedPnLValue = !!marketCtx.selectedTicker?.price @@ -346,9 +352,6 @@ const PositionClosedModal = ({ await wait(DELAYED_HIDDEN_SECONDS); globalCtx.eliminateAllModals(); - // Deprecated: (20230802 - Shirley) - // eslint-disable-next-line no-console - console.log('history right after closing', historyData); globalCtx.dataHistoryPositionModalHandler(historyData); globalCtx.visibleHistoryPositionModalHandler(); } else if ( diff --git a/src/components/trading_input/trading_input.tsx b/src/components/trading_input/trading_input.tsx index ddd955c2a..c78cb6788 100644 --- a/src/components/trading_input/trading_input.tsx +++ b/src/components/trading_input/trading_input.tsx @@ -207,9 +207,7 @@ const TradingInput = ({ return ( <> {' '} - {/* ---margin input area--- */}
- {/* '-.svg' symbol */}
- {/* '+.svg' symbol */} + +
+ + + {userCtx.enableServiceTerm ? ( + + ) : ( + <> + )} + {/* Info: (20230427 - Julian) Other tabs */} +
+ + + ); + const isDisplayedTickerSelectorBox = tickerSelectorBoxVisible ? ( <>
@@ -335,7 +389,7 @@ const TickerSelectorBox = ({ {/* Info: (20230427 - Julian) ----- body ----- */} {/* Info: (20230427 - Julian) tab section */} -
{tabPart}
+
{tabPartMobile}
{/* Info: (20230427 - Julian) Card section */} -
-
+
+
{displayedCryptoCards}
diff --git a/tailwind.config.js b/tailwind.config.js index 2401ed173..12a9ec9de 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -328,6 +328,7 @@ module.exports = { '3/5': '60%', }, borderRadius: { + '10px': '10px', '12px': '12px', }, rotate: {