Problem
Three frontend issues in AssetBadge affect visual consistency, layout, and the public API surface.
1. ASSET_COLORS maps only 5 assets — all others get identical grey (src/components/AssetBadge.tsx, lines 6–13)
XLM, USDC, USDT, BTC, ETH get distinct colours. Every other asset (AQUA, yXLM, SHX, etc.) gets the same grey bg-surface-2 text-ink-2. Users with 10+ tokens see visually identical grey badges for most of them.
2. code.slice(0, 2) renders incorrectly for 1-character asset codes
A 1-char asset code renders a single off-center character in a container sized for two. No minimum padding or centering adjustment exists.
3. AssetPill is absent from src/components/index.ts
AssetPill is exported from AssetBadge.tsx but missing from index.ts. Library consumers cannot import it from "sorokit-ui" without using the internal file path.
Solution
- Replace the static map with a hash-based colour picker (deterministic per code, from a palette of 8–10 colours).
- Handle 1-char codes with centered layout:
code.slice(0, 2).padStart(2, " ") or CSS centering.
- Add
export { AssetPill } from "./AssetBadge" to index.ts.
Acceptance Criteria
Note for Contributors: Write a clear PR description. Include a screenshot of the balance list with 8+ diverse assets showing distinct badge colours, and explain the hash-to-colour algorithm.
Problem
Three frontend issues in
AssetBadgeaffect visual consistency, layout, and the public API surface.1.
ASSET_COLORSmaps only 5 assets — all others get identical grey (src/components/AssetBadge.tsx, lines 6–13)XLM,USDC,USDT,BTC,ETHget distinct colours. Every other asset (AQUA,yXLM,SHX, etc.) gets the same greybg-surface-2 text-ink-2. Users with 10+ tokens see visually identical grey badges for most of them.2.
code.slice(0, 2)renders incorrectly for 1-character asset codesA 1-char asset code renders a single off-center character in a container sized for two. No minimum padding or centering adjustment exists.
3.
AssetPillis absent fromsrc/components/index.tsAssetPillis exported fromAssetBadge.tsxbut missing fromindex.ts. Library consumers cannot import it from"sorokit-ui"without using the internal file path.Solution
code.slice(0, 2).padStart(2, " ")or CSS centering.export { AssetPill } from "./AssetBadge"toindex.ts.Acceptance Criteria
AssetPillis importable from"sorokit-ui"npm run buildpasses