From 01acc19401a5d54502612a8277ce1c7adb36a65b Mon Sep 17 00:00:00 2001 From: LGram16 Date: Sun, 1 Feb 2026 00:56:54 +0900 Subject: [PATCH] .. --- Dockerfile | 1 - components/CommonUI.tsx | 14 +++--- components/StockRow.tsx | 28 +++++------ pages/Dashboard.tsx | 108 +++++++++++++++++++++++++++------------- 4 files changed, 94 insertions(+), 57 deletions(-) diff --git a/Dockerfile b/Dockerfile index bcf0647..985c337 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,6 @@ COPY package*.json ./ RUN npm install --omit=dev # 서버 파일 및 빌드 결과물 복사 -COPY server.js ./ COPY --from=build /app/dist ./dist # 환경변수 포트 노출 diff --git a/components/CommonUI.tsx b/components/CommonUI.tsx index 5197308..6cdf97d 100644 --- a/components/CommonUI.tsx +++ b/components/CommonUI.tsx @@ -11,18 +11,18 @@ interface StatCardProps { } export const StatCard: React.FC = ({ title, value, change, isUp, icon }) => ( -
-
-

{title}

-

{value}

+
+
+

{title}

+

{value}

{change && ( -

+

{change}

)}
-
- {icon} +
+ {React.cloneElement(icon as React.ReactElement, { size: 18 })}
); diff --git a/components/StockRow.tsx b/components/StockRow.tsx index ca68f0c..b2d6d51 100644 --- a/components/StockRow.tsx +++ b/components/StockRow.tsx @@ -25,11 +25,11 @@ export const StockRow: React.FC = ({ className="group cursor-pointer transition-colors hover:bg-slate-50/70" > {showRank && ( - + {rank} )} - +
{onToggleWatchlist && (
- {stock.name} + {stock.name} {stock.code}
- + {stock.market === MarketType.DOMESTIC ? stock.price.toLocaleString() + '원' : '$' + stock.price} - + {showPL ? (
= 0 ? 'text-rose-500' : 'text-blue-600'}> -

{showPL.pl.toLocaleString()}

-

({showPL.percent.toFixed(2)}%)

+

{showPL.pl.toLocaleString()}

+

({showPL.percent.toFixed(2)}%)

) : ( - = 0 ? 'text-rose-500' : 'text-blue-600'}`}> + = 0 ? 'text-rose-500' : 'text-blue-600'}`}> {stock.changePercent >= 0 ? '+' : ''}{stock.changePercent}% )} {showRatioBar && ( - +
-
+
{stock.buyRatio || 50} {stock.sellRatio || 50}
@@ -78,10 +78,10 @@ export const StockRow: React.FC = ({ )} {showActions && onTrade && ( - -
- - + +
+ +
)} diff --git a/pages/Dashboard.tsx b/pages/Dashboard.tsx index 3ec9ff0..1a65059 100644 --- a/pages/Dashboard.tsx +++ b/pages/Dashboard.tsx @@ -1,7 +1,7 @@ import React, { useState, useEffect, useMemo } from 'react'; import { - TrendingUp, Wallet, Activity, Briefcase, PieChart, Database, Zap, Timer, Trash2 + TrendingUp, TrendingDown, Wallet, Activity, Briefcase, PieChart, Database, Zap, Timer, Trash2, Globe, ArrowUpRight, ArrowDownRight, ChevronRight } from 'lucide-react'; import { StockItem, TradeOrder, MarketType, WatchlistGroup, OrderType, AutoTradeConfig, ReservedOrder } from '../types'; import { DbService, HoldingItem } from '../services/dbService'; @@ -23,6 +23,40 @@ interface DashboardProps { onRefreshHoldings: () => void; } +const IndexBar = () => { + const indices = [ + { name: '코스피', value: '2,561.32', change: '+12.45', percent: '0.49%', isUp: true }, + { name: '코스닥', value: '842.11', change: '-3.21', percent: '0.38%', isUp: false }, + { name: '나스닥', value: '15,628.95', change: '+215.12', percent: '1.40%', isUp: true }, + { name: 'S&P 500', value: '4,850.12', change: '+45.23', percent: '0.94%', isUp: true }, + { name: 'USD/KRW', value: '1,324.50', change: '+2.10', percent: '0.16%', isUp: true }, + ]; + + return ( +
+ {indices.map((idx, i) => ( +
+
+ {idx.name} + {idx.value} +
+
+ + {idx.isUp ? : } + {idx.percent} + + {idx.change} +
+
+ ))} + +
+ ); +}; + const Dashboard: React.FC = ({ marketMode, watchlistGroups, stocks, reservedOrders, onAddReservedOrder, onDeleteReservedOrder, onRefreshHoldings, orders }) => { @@ -86,29 +120,33 @@ const Dashboard: React.FC = ({ const selectedGroup = activeMarketGroups.find(g => g.id === activeGroupId) || activeMarketGroups[0]; return ( -
-
- } /> - = 0} icon={= 0 ? "text-emerald-500" : "text-rose-500"} />} /> - } /> - } /> +
+ {/* 1. 지수 및 환율 바 */} + + + {/* 2. 자산 현황 요약 */} +
+ } /> + = 0} icon={} /> + } /> + } />
-
-
-
-

- 관심 그룹 +
+
+
+

+ 관심 그룹

-
+
{activeMarketGroups.map(group => ( - ))}
-
+
{selectedGroup?.codes.map(code => stocks.find(s => s.code === code)).filter(s => s?.market === marketMode).map(stock => { @@ -128,21 +166,21 @@ const Dashboard: React.FC = ({ -
-
-
-

- 보유 포트폴리오 +
+
+
+

+ 보유 포트폴리오

- - - - - + + + + + @@ -165,19 +203,19 @@ const Dashboard: React.FC = ({ -
-

- 실시간 감시 목록 +
+

+ 실시간 감시 목록

-
+
{reservedOrders.filter(o => o.market === marketMode).map(order => ( -
-
-
-

{order.stockName}

+
+
+
+

{order.stockName}

-
))}

종목현재가수익금 (%)주문
종목현재가수익금 (%)주문