feat(ui): 관심종목(localStorage) + DART 공시 패널
- web/lib/watchlist.ts: KEY=stockchart.watchlist, storage+custom event 구독 - StarButton: 종목 페이지 헤더에서 ☆/★ 토글 - /watchlist 페이지: 카드 그리드 + 현재가/전일대비 + ✕ 제거 - DisclosuresPanel: 기존 /api/news?source=dart 재사용 (백엔드 신설 없음) - 종목 페이지 하단에 공시 패널 부착, 홈에 ★ 관심종목 링크 추가 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -2,12 +2,14 @@
|
||||
|
||||
import Link from "next/link";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { DisclosuresPanel } from "../../components/DisclosuresPanel";
|
||||
import { MetricsPanel } from "../../components/MetricsPanel";
|
||||
import { NewsList } from "../../components/NewsList";
|
||||
import { PeriodTabs, periodSpec, type Period } from "../../components/PeriodTabs";
|
||||
import { PredictionPanel } from "../../components/PredictionPanel";
|
||||
import { PriceHero } from "../../components/PriceHero";
|
||||
import { RelatedStocks } from "../../components/RelatedStocks";
|
||||
import { StarButton } from "../../components/StarButton";
|
||||
import { StockChart } from "../../components/StockChart";
|
||||
import { SymbolSidebar } from "../../components/SymbolSidebar";
|
||||
import { api, type ChartPayload, type LatestPredictionResponse } from "../../lib/api";
|
||||
@@ -89,10 +91,21 @@ export default function CodePage({ params }: { params: { code: string } }) {
|
||||
return (
|
||||
<main className="mx-auto max-w-5xl px-6 py-8">
|
||||
<div className="mb-4 flex items-center justify-between gap-3">
|
||||
<Link href="/" className="text-xs text-zinc-500 hover:text-zinc-300">
|
||||
← 검색
|
||||
</Link>
|
||||
<PeriodTabs value={period} onChange={(id) => setPeriod(id)} />
|
||||
<div className="flex items-center gap-3">
|
||||
<Link href="/" className="text-xs text-zinc-500 hover:text-zinc-300">
|
||||
← 검색
|
||||
</Link>
|
||||
<Link
|
||||
href="/watchlist"
|
||||
className="text-xs text-zinc-500 hover:text-zinc-300"
|
||||
>
|
||||
관심종목
|
||||
</Link>
|
||||
</div>
|
||||
<div className="flex items-center gap-3">
|
||||
<StarButton code={code} name={chart?.name} />
|
||||
<PeriodTabs value={period} onChange={(id) => setPeriod(id)} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{err && <div className="mb-4 text-sm text-red-400">차트 로딩 실패: {err}</div>}
|
||||
@@ -129,6 +142,9 @@ export default function CodePage({ params }: { params: { code: string } }) {
|
||||
<MetricsPanel code={code} />
|
||||
<NewsList code={code} />
|
||||
</div>
|
||||
<div className="mt-6">
|
||||
<DisclosuresPanel code={code} />
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user