Skip to content

feat(mobile): add shared UI primitives - #532

Merged
Miracle656 merged 3 commits into
Miracle656:mainfrom
Ipramking:feat/mobile-ui-primitives
Jul 28, 2026
Merged

feat(mobile): add shared UI primitives#532
Miracle656 merged 3 commits into
Miracle656:mainfrom
Ipramking:feat/mobile-ui-primitives

Conversation

@Ipramking

Copy link
Copy Markdown
Contributor

What

The reusable components every screen composes from — native ports of the web wallet's core CSS classes (frontend/wallet/app/globals.css), so feature screens don't re-implement layout chrome.

Primitives (frontend/mobile/components/ui/)

Component Ports Notes
Screen .wallet-shell Full-height near-black shell + safe-area insets
Card .card / .card-md variant="md" = raised surface
Button .btn-gold / .btn-ghost Gold (filled) + ghost (outline) variants; press-scale + disabled
AddressChip .address-chip Inconsolata pill, tap-to-copy (expo-clipboard), middle-truncates
Highlight .hl Gold highlighter underlay
  • theme/colors.ts — native palette mirroring the :root CSS variables (exact hex/rgba).
  • app/_layout.tsx — wrapped in SafeAreaProvider (required by Screen).
  • app/ui.tsx — a /ui gallery rendering every primitive for side-by-side comparison with the web wallet.
  • Adds expo-clipboard (~57.0.1, SDK-aligned) for the chip copy.

Note — React Native constraint: RN can't gradient-fill inline text, so Highlight is a block element with a flat translucent gold band behind the lower ~40% (documented in the file). Everything else is a 1:1 port of the CSS values.

Stacked on #531

This builds on the typography module from #432 (PR #531)Button/AddressChip import theme/typography.ts. Until #531 merges, this PR's diff includes that fonts commit; review the feat(mobile): add shared UI primitives commit for this issue's work. Once #531 merges I'll rebase and the fonts commit drops out.

Acceptance

each primitive rendered in a demo screen matches the web look side-by-side.

/ui renders all five primitives against the ported values.

Verification (local — no mobile CI job in this repo)

  • npm run typecheck (tsc --noEmit) ✅
  • eslint on all new files ✅ clean

Closes #433

The mobile shell rendered everything in the system font. Load the four
brand typefaces at startup with useFonts and hold render behind the splash
screen so the UI never flashes a system font.

- theme/typography.ts: font assets + role→family map + role text styles,
  mirroring the web wallet (Lora 600 italic headings, Anton accent caps at
  0.08em, Inter body, Inconsolata addresses/hashes).
- app/_layout.tsx: preventAutoHideAsync + useFonts(fontAssets); render held
  until fonts resolve, then hideAsync.
- app/fonts.tsx: a /fonts specimen screen rendering all four roles.

Closes Miracle656#432
Build the reusable components every screen composes from, as native ports
of the web wallet's core CSS classes so feature screens don't re-implement
layout chrome.

- theme/colors.ts: native palette mirroring globals.css :root vars.
- components/ui/Screen.tsx (.wallet-shell shell + safe area), Card.tsx
  (.card/.card-md), Button.tsx (.btn-gold/.btn-ghost gold variants),
  AddressChip.tsx (.address-chip, Inconsolata + tap-to-copy via
  expo-clipboard), Highlight.tsx (.hl gold underlay).
- app/_layout.tsx: wrap in SafeAreaProvider (required by Screen).
- app/ui.tsx: /ui gallery rendering every primitive for side-by-side check.

Closes Miracle656#433
@Ipramking
Ipramking requested a review from Miracle656 as a code owner July 28, 2026 12:51
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Ipramking is attempting to deploy a commit to the miracle656's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Ipramking Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

…ives

# Conflicts:
#	frontend/mobile/app/_layout.tsx
#	frontend/mobile/package-lock.json
#	frontend/mobile/package.json
@Miracle656

Copy link
Copy Markdown
Owner

Thanks @Ipramking — shared UI primitives (Button, Card, Screen, AddressChip, Highlight) with a barrel export and a ui.tsx gallery route, built on the typography module from #432. Gives later screens something consistent to compose from instead of re-inventing inline styles. Closes #433. Merging once CI is green.

@Miracle656
Miracle656 merged commit 4c478fd into Miracle656:main Jul 28, 2026
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5. Shared UI primitives

3 participants