Skip to content

fix(AssetBadge): only 5 hardcoded colours, 1-char code off-center, AssetPill not exported from index.ts #90

Description

@k-deejah

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

  1. Replace the static map with a hash-based colour picker (deterministic per code, from a palette of 8–10 colours).
  2. Handle 1-char codes with centered layout: code.slice(0, 2).padStart(2, " ") or CSS centering.
  3. Add export { AssetPill } from "./AssetBadge" to index.ts.

Acceptance Criteria

  • Every unique asset code renders with a distinct, consistent colour
  • 1-char asset codes are centered in the icon circle
  • AssetPill is importable from "sorokit-ui"
  • npm run build passes

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.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions