From 316eaa4c7de3a9658c16a724fb90c3298ef29d00 Mon Sep 17 00:00:00 2001 From: jasxyz Date: Wed, 5 Aug 2026 23:08:32 -0700 Subject: [PATCH 1/2] feat: add Market Resolution dashboard page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 把設計側完成的 Market Resolution 集中結算頁接進 production:真 @olab/components、 真 token、真 route。資料層仍是 mock(Api.Detail.getResolutionList / DisputeApi 未接), 這一版的目的是讓定稿設計在 production 環境下可被實際檢視與驗證。 內容: - src/components/ResolutionDashboard/:結算列表 + My Disputes + How it works + dispute flow。原本設計 repo 裡的 @olab 轉接層已拆除,全部直接 import @olab/components。 - packages/components/.../TextLink/:設計側新增、production 原本沒有的元件, 以新檔案加入,並在 index.tsx 補一行 export(不動既有元件)。 - src/index.css:補 --font-number(指向既有的 --font-secondary)。設計側以 font-number 標記所有數字欄位,production 原本沒有這個變數,缺了會靜默失效、 金額數字全部掉回內文字體。 - src/app/resolution/:route 與 SEO metadata / breadcrumb JSON-LD。 與既有元件的關係: - ResolutionDashboard/dispute-modal.tsx 是既有 src/components/DisputeModal 的超集, 多了 marketTitle / subtopic(集中列表頁沒有 market detail 的標題上下文)與 DisputeUnavailableReason(列表頁才會遇到的搶先 / 視窗關閉)。刻意不覆蓋原元件, 兩者是否合併留待決定。 - 既有 src/components/MarketResolution 是單一市場的結算時間軸,與本頁互補,未改動。 已驗證:tsc 對本次新增檔案 0 error;dev server 實跑 /resolution,dark / light 兩模式 渲染正常、倒數運作、dispute modal 走得通、font-number 實測解析到 spaceMono。 待確認的唯一視覺偏離:dispute modal 的 textarea placeholder 使用 text-quaternary 取代既有的 raw hex #86868D,兩者非同色。 Co-Authored-By: Claude Fable 5 --- .../components/TextLink/TextLink.stories.tsx | 180 +++++ .../src/components/TextLink/index.tsx | 89 +++ packages/components/src/index.tsx | 1 + src/app/resolution/layout.tsx | 57 ++ src/app/resolution/page.tsx | 10 + .../ResolutionDashboard/countdown-timer.tsx | 70 ++ .../dashboard-rows-view.tsx | 226 ++++++ .../ResolutionDashboard/dispute-modal.tsx | 320 ++++++++ .../ResolutionDashboard/dispute-table.tsx | 261 +++++++ .../how-it-works-dashboard.tsx | 418 +++++++++++ .../ResolutionDashboard/leg-derive.ts | 118 +++ .../ResolutionDashboard/leg-parts.tsx | 236 ++++++ .../ResolutionDashboard/mock-data.ts | 688 ++++++++++++++++++ .../ResolutionDashboard/my-disputes-rows.tsx | 500 +++++++++++++ .../resolution-list-view.tsx | 548 ++++++++++++++ .../ResolutionDashboard/stage-icons.tsx | 175 +++++ .../ResolutionDashboard/step-tabs.tsx | 152 ++++ src/index.css | 3 + 18 files changed, 4052 insertions(+) create mode 100644 packages/components/src/components/TextLink/TextLink.stories.tsx create mode 100644 packages/components/src/components/TextLink/index.tsx create mode 100644 src/app/resolution/layout.tsx create mode 100644 src/app/resolution/page.tsx create mode 100644 src/components/ResolutionDashboard/countdown-timer.tsx create mode 100644 src/components/ResolutionDashboard/dashboard-rows-view.tsx create mode 100644 src/components/ResolutionDashboard/dispute-modal.tsx create mode 100644 src/components/ResolutionDashboard/dispute-table.tsx create mode 100644 src/components/ResolutionDashboard/how-it-works-dashboard.tsx create mode 100644 src/components/ResolutionDashboard/leg-derive.ts create mode 100644 src/components/ResolutionDashboard/leg-parts.tsx create mode 100644 src/components/ResolutionDashboard/mock-data.ts create mode 100644 src/components/ResolutionDashboard/my-disputes-rows.tsx create mode 100644 src/components/ResolutionDashboard/resolution-list-view.tsx create mode 100644 src/components/ResolutionDashboard/stage-icons.tsx create mode 100644 src/components/ResolutionDashboard/step-tabs.tsx diff --git a/packages/components/src/components/TextLink/TextLink.stories.tsx b/packages/components/src/components/TextLink/TextLink.stories.tsx new file mode 100644 index 0000000..43fd5a9 --- /dev/null +++ b/packages/components/src/components/TextLink/TextLink.stories.tsx @@ -0,0 +1,180 @@ +import React from "react"; +import type { Meta, StoryObj } from "@storybook/react-vite"; +import { TextLink } from "."; +import { Icon } from "../Icon"; + +const meta: Meta = { + title: "Components/Atoms/TextLink", + component: TextLink, + parameters: { + docs: { + description: { + component: + "文字連結。核心規則:字與底線永遠同色;hover 沿自身色階亮一階(具名 token);pressed 統一 opacity 80%;inline(句中)常駐底線、standalone(獨立成行)rest 藏線 hover 浮現。有 href 渲染 、無 href 渲染 + ); +}); + +export { TextLink }; diff --git a/packages/components/src/index.tsx b/packages/components/src/index.tsx index 8e22a97..76dfd4b 100644 --- a/packages/components/src/index.tsx +++ b/packages/components/src/index.tsx @@ -20,6 +20,7 @@ export * from "./components/Spinner"; export * from "./components/Switch"; export * from "./components/Table"; export * from "./components/Tabs"; +export * from "./components/TextLink"; export * from "./components/Toast"; export * from "./components/Typography"; export * from "./components/Tooltip"; diff --git a/src/app/resolution/layout.tsx b/src/app/resolution/layout.tsx new file mode 100644 index 0000000..4a53dc6 --- /dev/null +++ b/src/app/resolution/layout.tsx @@ -0,0 +1,57 @@ +import { Metadata } from "next"; + +export const metadata: Metadata = { + title: "OPINION | Market Resolution", + description: + "Track how OPINION Prediction Markets settle: proposed outcomes, dispute windows, committee review, and payouts.", + openGraph: { + title: "OPINION | Market Resolution", + description: + "Track how OPINION Prediction Markets settle: proposed outcomes, dispute windows, committee review, and payouts.", + }, + twitter: { + title: "OPINION | Market Resolution", + description: + "Track how OPINION Prediction Markets settle: proposed outcomes, dispute windows, committee review, and payouts.", + card: "summary_large_image", + site: "@opinionlabsxyz", + }, + alternates: { + canonical: "/resolution", + }, +}; + +const breadcrumbJsonLd = { + "@context": "https://schema.org", + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: "https://app.opinion.trade", + }, + { + "@type": "ListItem", + position: 2, + name: "Market Resolution", + item: "https://app.opinion.trade/resolution", + }, + ], +}; + +export default function ResolutionLayout({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { + return ( + <> +