보안 점검 및 대시보드 문구 수정
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
import { useRouter } from "next/navigation";
|
||||
import { usePriceFlash } from "@/features/dashboard/hooks/use-price-flash";
|
||||
import type { DashboardHoldingItem } from "@/features/dashboard/types/dashboard.types";
|
||||
import { useTradeNavigationStore } from "@/features/trade/store/use-trade-navigation-store";
|
||||
import {
|
||||
formatCurrency,
|
||||
formatPercent,
|
||||
@@ -45,6 +46,9 @@ export function StockDetailPreview({
|
||||
totalAmount,
|
||||
}: StockDetailPreviewProps) {
|
||||
const router = useRouter();
|
||||
const setPendingTarget = useTradeNavigationStore(
|
||||
(state) => state.setPendingTarget,
|
||||
);
|
||||
// [State/Hook] 실시간 가격 변동 애니메이션 상태 관리
|
||||
// @remarks 종목이 선택되지 않았을 때를 대비해 safe value(0)를 전달하며, 종목 변경 시 효과를 초기화하도록 symbol 전달
|
||||
const currentPrice = holding?.currentPrice ?? 0;
|
||||
@@ -92,11 +96,14 @@ export function StockDetailPreview({
|
||||
<CardDescription className="flex items-center gap-1.5 flex-wrap">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
router.push(
|
||||
`/trade?symbol=${holding.symbol}&name=${encodeURIComponent(holding.name)}`,
|
||||
)
|
||||
}
|
||||
onClick={() => {
|
||||
setPendingTarget({
|
||||
symbol: holding.symbol,
|
||||
name: holding.name,
|
||||
market: holding.market,
|
||||
});
|
||||
router.push("/trade");
|
||||
}}
|
||||
className={cn(
|
||||
"group flex items-center gap-1.5 rounded-md border border-brand-200 bg-brand-50 px-2 py-0.5",
|
||||
"text-sm font-bold text-brand-700 transition-all cursor-pointer",
|
||||
|
||||
Reference in New Issue
Block a user