Files
zeekayandHanzo Dev da98c0de75 feat(console): one icon set — every glyph comes from @luxfi/ui/icons
74 files imported `lucide-react` directly, pinned ^1.26.0, while @luxfi/ui —
which this console renders alongside — resolves 1.27. Two Lucide copies from two
resolutions in one bundle is how a set stops being one set. Two more glyphs were
not from any icon library at all: the node list drew its network in/out arrows as
the literal characters "↓" and "↑", and the chain onboarding selector drew its
tick as "✓". Those are font glyphs — they take the text metrics, not the icon
box, so they sit on a different baseline and scale with the font, not `size-*`.

One source now: `@luxfi/ui/icons`, Lucide as @hanzo/gui standardises on it and
@luxfi/ui themes it. `lucide-react` is out of package.json, so per-surface drift
is no longer expressible; @luxfi/ui comes in at 7.4.3, which is where `./icons`
lives. The three text glyphs are ArrowDown / ArrowUp / Check.

All 121 distinct icon names this console uses were checked against the 6014
symbols @luxfi/ui/icons exports before the rewrite — zero missing, with a
negative control. `next build` is clean: 78 routes, Next 16.2.11 + Turbopack.

The d3 chart roots (node-globe, node-map, globe-view, donut-chart, fleet-map)
keep their <svg>: those are plots, not glyphs. The command menu's "↑↓" stays —
it is a keyboard legend inside <kbd>, and it means the keys.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-27 14:57:55 -07:00

75 lines
2.4 KiB
TypeScript

"use client"
import { AppProvider, IdentityProvider } from "@luxfi/ui"
import { QueryClient } from "@tanstack/react-query"
import { useEffect, useState } from "react"
import { setReturnUrl } from "@/lib/iam"
// Brand + identity, both from the HOST.
//
// `AppProvider` (@luxfi/ui) mounts the @hanzo/gui engine on the host-resolved
// theme row and carries the white-label — the same resolver lib/brand.ts now
// reads its OIDC triple from, so there is one answer to "which brand is this"
// and not two that can disagree.
//
// `IdentityProvider` reads the signed-in account and its org membership from
// IAM. Credentials stay where they already are: lib/iam owns the PKCE flow and
// localStorage["bootnode_token"] the bearer, so the chrome adds no second token
// store and no second refresh timer — it borrows the bearer and two verbs.
const TOKEN_KEY = "bootnode_token"
const readToken = (): string | null => {
if (typeof window === "undefined") return null
try {
return window.localStorage.getItem(TOKEN_KEY)
} catch {
return null
}
}
/** Sign-in goes through /login, which is what drives the SDK's PKCE redirect. */
const signIn = (): void => {
setReturnUrl(window.location.pathname + window.location.search)
window.location.assign("/login")
}
/** Sign-out drops the bearer and returns to the marketing root. */
const signOut = (): void => {
try {
window.localStorage.removeItem(TOKEN_KEY)
window.localStorage.removeItem("bootnode_project_id")
} catch {
/* storage disabled — the redirect below still ends the session in this tab */
}
window.location.assign("/")
}
export function Providers({ children }: { children: React.ReactNode }) {
const [queryClient] = useState(
() =>
new QueryClient({
defaultOptions: {
queries: {
staleTime: 60 * 1000, // 1 minute
refetchOnWindowFocus: false,
},
},
})
)
// `output: "export"` prerenders with no Host header, so the first paint is
// the default row and the real host arrives after hydration — deterministic
// on both sides, so there is no mismatch.
const [host, setHost] = useState<string | undefined>(undefined)
useEffect(() => setHost(window.location.host), [])
return (
<AppProvider host={host} queryClient={queryClient}>
<IdentityProvider auth={{ token: readToken, signIn, signOut }}>
{children}
</IdentityProvider>
</AppProvider>
)
}