@@ -238,7 +238,7 @@ export default function HoldingEditModal({ fund, holding, onClose, onSave }) {
-
-
+
+
);
}
diff --git a/app/components/PendingTradesModal.jsx b/app/components/PendingTradesModal.jsx
new file mode 100644
index 0000000..d14bfc3
--- /dev/null
+++ b/app/components/PendingTradesModal.jsx
@@ -0,0 +1,94 @@
+'use client';
+
+import { CloseIcon } from './Icons';
+import {
+ Dialog,
+ DialogContent,
+ DialogTitle,
+} from '@/components/ui/dialog';
+import { Button } from '@/components/ui/button';
+
+export default function PendingTradesModal({
+ open,
+ trades = [],
+ onClose,
+ onRevoke,
+}) {
+ const handleOpenChange = (nextOpen) => {
+ if (!nextOpen) {
+ onClose?.();
+ }
+ };
+
+ return (
+
+ );
+}
+
diff --git a/app/components/TradeModal.jsx b/app/components/TradeModal.jsx
index 92e18b8..a5059df 100644
--- a/app/components/TradeModal.jsx
+++ b/app/components/TradeModal.jsx
@@ -1,7 +1,7 @@
'use client';
import { useEffect, useMemo, useState } from 'react';
-import { AnimatePresence, motion } from 'framer-motion';
+import { AnimatePresence } from 'framer-motion';
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import timezone from 'dayjs/plugin/timezone';
@@ -10,6 +10,12 @@ import { fetchSmartFundNetValue } from '../api/fund';
import { DatePicker, NumericInput } from './Common';
import ConfirmModal from './ConfirmModal';
import { CloseIcon } from './Icons';
+import {
+ Dialog,
+ DialogContent,
+ DialogTitle,
+} from '@/components/ui/dialog';
+import PendingTradesModal from './PendingTradesModal';
dayjs.extend(utc);
dayjs.extend(timezone);
@@ -153,36 +159,33 @@ export default function TradeModal({ type, fund, holding, onClose, onConfirm, pe
const [revokeTrade, setRevokeTrade] = useState(null);
+ const handleOpenChange = (open) => {
+ if (!open) {
+ onClose?.();
+ }
+ };
+
return (
-
-
+ e.stopPropagation()}
- style={{ maxWidth: '420px' }}
+ overlayClassName="modal-overlay"
+ overlayStyle={{ zIndex: 99 }}
+ style={{ maxWidth: '420px', width: '90vw', zIndex: 99 }}
>
+ {isBuy ? '加仓' : '减仓'}
{isBuy ? '📥' : '📤'}
- {showPendingList ? '待交易队列' : (showConfirm ? (isBuy ? '买入确认' : '卖出确认') : (isBuy ? '加仓' : '减仓'))}
+ {showConfirm ? (isBuy ? '买入确认' : '卖出确认') : (isBuy ? '加仓' : '减仓')}
- {!showPendingList && !showConfirm && currentPendingTrades.length > 0 && (
+ {!showConfirm && currentPendingTrades.length > 0 && (
setShowPendingList(true)}
@@ -192,49 +195,6 @@ export default function TradeModal({ type, fund, holding, onClose, onConfirm, pe
)}
- {showPendingList ? (
-
-
-
-
-
- {currentPendingTrades.map((trade, idx) => (
-
-
-
- {trade.type === 'buy' ? '买入' : '卖出'}
-
- {trade.date} {trade.isAfter3pm ? '(15:00后)' : ''}
-
-
- 份额/金额
- {trade.share ? `${trade.share} 份` : `¥${trade.amount}`}
-
-
-
状态
-
- 等待净值更新...
-
-
-
-
- ))}
-
-
- ) : (
- <>
{!showConfirm && (
{fund?.name}
@@ -316,10 +276,10 @@ export default function TradeModal({ type, fund, holding, onClose, onConfirm, pe
@@ -398,7 +358,7 @@ export default function TradeModal({ type, fund, holding, onClose, onConfirm, pe
-
@@ -108,13 +129,16 @@ export default function TransactionHistoryModal({