diff --git a/frontend/src/components/PaperTradingPage.tsx b/frontend/src/components/PaperTradingPage.tsx index 1350f15..9202891 100644 --- a/frontend/src/components/PaperTradingPage.tsx +++ b/frontend/src/components/PaperTradingPage.tsx @@ -23,7 +23,7 @@ import PaperPendingOrdersList from './paper/PaperPendingOrdersList'; import PaperLedgerTab from './paper/PaperLedgerTab'; import PaperAssetTrendChart from './paper/PaperAssetTrendChart'; import { computePaperMetrics } from '../utils/paperMetrics'; -import { TradeTabOrderPanel, TradeOrderbookPanelContent, TradeRightPanelBody } from './trade'; +import { TradeSplitOrderPanel, TradeOrderbookPanelContent, TradeRightPanelBody } from './trade'; import type { Theme, TradeOrderFillRequest } from '../types'; import PaperAnalysisChart from './paper/PaperAnalysisChart'; import PaperLeftStrategyTab from './paper/PaperLeftStrategyTab'; @@ -38,7 +38,7 @@ import { formatVirtualTargetOptionLabel } from '../utils/virtualTargetNames'; type HistoryTab = 'open' | 'recent' | 'ledger'; type CenterTab = 'invest' | 'chart'; -type RightTab = 'trade' | 'orderbook'; +type RightTab = 'trade' | 'orderbook' | 'history'; type LeftTab = 'strategy' | 'settings'; interface Props { @@ -140,7 +140,7 @@ const PaperTradingPage: React.FC = ({ } finally { setInitialLoading(false); } - if (opts?.focusHistory) setRightTab('trade'); + if (opts?.focusHistory) setRightTab('history'); }, []); useEffect(() => { @@ -293,33 +293,7 @@ const PaperTradingPage: React.FC = ({
-
- ); - - const tradeHistorySlot = ( -
-
- - - -
-
- {historyTab === 'open' ? ( - void loadData()} /> - ) : historyTab === 'ledger' ? ( - - ) : ( - - )} -
+
); @@ -445,7 +419,7 @@ const PaperTradingPage: React.FC = ({ right={( {rightTab === 'trade' ? ( - = ({ paperTradingEnabled={paperTradingEnabled} paperAutoTradeEnabled={paperAutoTradeEnabled} onPaperOrderFilled={() => void loadData({ focusHistory: true })} - historySlot={tradeHistorySlot} /> - ) : ( + ) : rightTab === 'orderbook' ? ( = ({ tradeStrength={tradeStrength ?? undefined} onRowClick={handleOrderbookRowClick} /> + ) : ( +
+
+ + + +
+
+ {historyTab === 'open' ? ( + void loadData()} /> + ) : historyTab === 'ledger' ? ( + + ) : ( + + )} +
+
)}
)} diff --git a/frontend/src/components/RightSidePanel.tsx b/frontend/src/components/RightSidePanel.tsx index aa22a8a..f333ad1 100644 --- a/frontend/src/components/RightSidePanel.tsx +++ b/frontend/src/components/RightSidePanel.tsx @@ -5,7 +5,7 @@ */ import React, { useState, useEffect, useRef, useCallback } from 'react'; import { - TradeTabOrderPanel, + TradeSplitOrderPanel, TradeOrderbookPanelContent, TradeRightPanelTabs, TradeRightPanelBody, @@ -158,7 +158,7 @@ const RightSidePanel: React.FC = ({ {activeTab === 'trade' && ( - = ({ paperTradingEnabled={paperTradingEnabled} paperAutoTradeEnabled={paperAutoTradeEnabled} onPaperOrderFilled={onPaperOrderFilled} - hideHistory /> )} diff --git a/frontend/src/components/TradeNotificationListPage.tsx b/frontend/src/components/TradeNotificationListPage.tsx index 24e40b9..4e99d29 100644 --- a/frontend/src/components/TradeNotificationListPage.tsx +++ b/frontend/src/components/TradeNotificationListPage.tsx @@ -23,7 +23,7 @@ import BacktestAnalysisReportModal from './backtest/BacktestAnalysisReportModal' import type { BacktestAnalysisReportModel } from './backtest/BacktestAnalysisReportModal'; import { coerceFiniteNumber } from '../utils/safeFormat'; import { - TradeTabOrderPanel, + TradeSplitOrderPanel, TradeOrderbookPanelContent, TradeRightPanelTabs, TradeRightPanelBody, @@ -753,7 +753,7 @@ export const TradeNotificationListPage: React.FC = ({ bodyClassName="tnl-right-body" > {rightTab === 'trade' ? ( - = ({ paperTradingEnabled={paperTradingEnabled} paperAutoTradeEnabled={paperAutoTradeEnabled} onPaperOrderFilled={() => void refreshPaperData()} - hideHistory /> ) : ( = ({ setTrades(tr); } catch { /* ignore */ } onPaperOrderFilled?.(); - if (opts?.focusHistory) setRightTab('trade'); + if (opts?.focusHistory) setRightTab('history'); }, [onPaperOrderFilled]); const handleGlobalDisplayModeChange = useCallback((mode: VirtualCardDisplayMode) => { @@ -472,20 +472,10 @@ const VirtualTradingPage: React.FC = ({
+
); - const tradeHistorySlot = ( - - ); - return ( = ({ right={( {rightTab === 'trade' ? ( - = ({ paperTradingEnabled={paperTradingEnabled} paperAutoTradeEnabled={paperAutoTradeEnabled} onPaperOrderFilled={() => void refreshPaperData({ focusHistory: true })} - historySlot={tradeHistorySlot} /> - ) : ( + ) : rightTab === 'orderbook' ? ( = ({ tradeStrength={tradeStrength ?? undefined} onRowClick={handleOrderbookRowClick} /> + ) : ( + )} )}