mirror of
https://github.com/luxwallet/ui.git
synced 2026-10-30 19:47:51 +00:00
Add real, recognizable SVG chain logos for every login ecosystem and render them across the wallet UI, replacing the bare emoji glyphs. - chain-icon-paths.ts: ONE source of truth — dependency-free SVG geometry for the 7 chains (Ethereum/EVM, Solana, Bitcoin, TON, XRP, Polkadot, Cardano). Monochrome currentColor marks (our own simplified renderings, MIT, no trademarked asset files) so they inherit the Lux/Hanzo monochrome theme while keeping each chain's identity. Web-only hosts (Hanzo IAM web) mirror this same data verbatim. - ChainIcon.tsx: cross-target component over react-native-svg (Svg/Path) — the SAME mark paints on web (react-native-web), extension, desktop, and native. react-native-svg is an OPTIONAL peer dep (like react-native) and stays EXTERNAL in the build, so no platform dep is bundled and the native build is unaffected. - chains.ts: LOGIN_CHAINS extended from 5 to all 7 (added polkadot + cardano); glyph kept as a fallback only. - ConnectWallet: chain picker renders each chain's ChainIcon (was glyph text). - ChainBadge: renders the real ChainIcon for known chains; glyph fallback only for free-form ecosystem chains. Tests: +4 geometry/contract tests (7 chains covered, valid 0..24 viewBox paths, glyph fallbacks present). typecheck + build green; RN-svg externalized in both esm/cjs output.
26 lines
1.0 KiB
TypeScript
26 lines
1.0 KiB
TypeScript
import { defineConfig } from "tsup"
|
|
|
|
// @luxwallet/ui ships compiled JS so consumers (extension webpack, desktop ERB,
|
|
// mobile metro) need no special transpile config. @hanzo/gui + react +
|
|
// react-native + react-native-svg stay EXTERNAL (peers) — the consumer supplies
|
|
// them, and @hanzo/gui's own precompiled output handles web (react-native-web)
|
|
// vs native. react-native-svg resolves to the web shim on web and the native
|
|
// module on RN, so the ChainIcon paints cross-target with no bundled platform
|
|
// dep. The component tree is platform-neutral (one source), so the
|
|
// react-native and browser export conditions both point at the same ESM build.
|
|
export default defineConfig({
|
|
entry: {
|
|
index: "src/index.ts",
|
|
theme: "src/theme/index.ts",
|
|
},
|
|
format: ["esm", "cjs"],
|
|
dts: true,
|
|
sourcemap: true,
|
|
clean: true,
|
|
treeshake: true,
|
|
external: ["@hanzo/gui", "react", "react-dom", "react-native", "react-native-web", "react-native-svg"],
|
|
outExtension({ format }) {
|
|
return { js: format === "esm" ? ".mjs" : ".cjs" }
|
|
},
|
|
})
|