말림목록 매매 버튼 추가

This commit is contained in:
Macbook
2026-06-06 03:25:11 +09:00
parent 4c057a3e07
commit 63c56a11b2
3 changed files with 32 additions and 0 deletions
@@ -190,6 +190,16 @@ export const TradeNotificationListPage: React.FC<Props> = ({
setRightTab('trade');
}, [tickers]);
/** 알림 목록 아이템 "매매" 버튼 — 우측 패널 열고 해당 종목 현재가 입력 */
const handleTradeFromAlert = useCallback((item: TradeNotificationItem) => {
if (!item.isRead) markAsRead(item.id);
const price = coerceFiniteNumber(tickers?.get(item.market)?.tradePrice)
?? coerceFiniteNumber(item.price);
handleSelectMarket(item.market, price ?? undefined);
setRightOpen(true);
setRightTab('trade');
}, [markAsRead, tickers, handleSelectMarket]);
const selectedCount = selectedIds.size;
const handleNotificationSelect = useCallback((item: TradeNotificationItem) => {
@@ -509,6 +519,7 @@ export const TradeNotificationListPage: React.FC<Props> = ({
markAsRead(item.id);
setFullscreenItem(item);
}}
onTrade={() => handleTradeFromAlert(item)}
tickers={tickers}
/>
))}
@@ -51,6 +51,8 @@ interface Props {
onDelete: (e: React.MouseEvent) => void;
onDetail: () => void;
onGoToChart: () => void;
/** 매매 버튼 클릭 → 우측 매매 패널 열기 */
onTrade?: () => void;
}
const MAX_INDICATOR_CARDS = 8;
@@ -67,6 +69,7 @@ const TradeNotificationListRow: React.FC<Props> = ({
onDelete,
onDetail,
onGoToChart,
onTrade,
}) => {
useTradeAlertTimeFormat();
const isBuy = item.signalType === 'BUY';
@@ -309,6 +312,11 @@ const TradeNotificationListRow: React.FC<Props> = ({
<button type="button" className="tnl-row-chart" onClick={onGoToChart}>
</button>
{onTrade && (
<button type="button" className="tnl-row-trade" onClick={onTrade}>
</button>
)}
</div>
</article>
);