diff --git a/app/layout.tsx b/app/layout.tsx index c8e3441..2c2056c 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -4,6 +4,7 @@ import { Inter, JetBrains_Mono } from "next/font/google"; import { Analytics } from "@vercel/analytics/next"; import { Toaster } from "sonner"; import { LocaleProvider } from "@/components/locale-provider"; +import { ThemeProvider } from "@/components/theme-provider"; import "./globals.css"; const inter = Inter({ subsets: ["latin"], variable: "--font-inter" }); @@ -26,7 +27,9 @@ export default function RootLayout({ children }: Readonly<{ children: React.Reac > Skip to content - {children} + + {children} + diff --git a/app/portal/page.tsx b/app/portal/page.tsx index 051f299..800168c 100644 --- a/app/portal/page.tsx +++ b/app/portal/page.tsx @@ -2,6 +2,7 @@ import Link from "next/link"; import { useCallback, useEffect, useState } from "react"; +import { toast } from "sonner"; import { Header } from "@/components/header"; import { EmptyState, ErrorState, LoadingSkeleton } from "@/components/states"; import { useT } from "@/components/locale-provider"; @@ -208,8 +209,9 @@ function Content({ href={`/order/${o.order_id}`} className="group grid grid-cols-[1.4fr_1.6fr_1fr_1fr_0.9fr] items-center border-b border-border px-5 py-4 transition-colors last:border-b-0 hover:bg-secondary/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset" > - + {shortId(o.order_id)} + {o.flow} @@ -268,6 +270,28 @@ function Stat({ label, value }: { label: string; value: string }) { ); } +function CopyId({ id }: { id: string }) { + const [copied, setCopied] = useState(false); + return ( + + ); +} + /** Square provenance-coloured state marker — no red here (reserved for the EmptyState CTA). */ function StatusDot({ status }: { status: string }) { const color = DELIVERED_STATES.has(status) diff --git a/components/header.tsx b/components/header.tsx index 8aa8095..7e7b3a9 100644 --- a/components/header.tsx +++ b/components/header.tsx @@ -2,6 +2,7 @@ import Link from "next/link"; import { useEffect, useState } from "react"; +import { useTheme } from "next-themes"; import { useT } from "@/components/locale-provider"; import { LocaleSwitcher } from "@/components/locale-switcher"; @@ -26,6 +27,24 @@ function Wordmark() { ); } +function ThemeToggle() { + const { resolvedTheme, setTheme } = useTheme(); + const [mounted, setMounted] = useState(false); + useEffect(() => setMounted(true), []); + if (!mounted) return ; + const dark = resolvedTheme === "dark"; + return ( + + ); +} + export function Header() { const t = useT(); const [scrolled, setScrolled] = useState(false); @@ -42,7 +61,7 @@ export function Header() {
@@ -63,6 +82,7 @@ export function Header() {
+ {t({ en: "Sign in", sv: "Logga in" })} @@ -100,7 +120,10 @@ export function Header() { ))}
- +
+ + +
setOpen(false)} className="bg-foreground px-5 py-3 font-mono text-[12px] uppercase tracking-[0.12em] text-background"> {t({ en: "Order", sv: "Beställ" })} → diff --git a/components/portal-shell.tsx b/components/portal-shell.tsx index a8d6855..d2eeef7 100644 --- a/components/portal-shell.tsx +++ b/components/portal-shell.tsx @@ -109,7 +109,7 @@ export function PortalShell({ {/* content */} -
+

{title}

{children}