Files
ui/pkgs/shop/components/SuccessStep.tsx
zeekayandGitHub 806fc0f0df decouple @hanzogui, standardize on 'pkgs/', etc (#228)
* refactor: decouple @hanzo/ui from hanzogui

  Make @hanzo/ui shadcn-only — no hanzogui/Tamagui coupling.

  - remove primitives/bases (gui/admin/svelte/vue) re-exports
  - drop @hanzogui peerDependencies + peerDependenciesMeta entries
  - add check-no-hanzogui guard, wired into build
  - fix latent NodeJS.Timeout types to keep the build green

* refactor: remove duplicate @hanzo/brand from the monorepo

  @hanzo/brand is owned by the standalone hanzoai/brand (the npm-canonical
  source); this monorepo's copy was unused and had drifted.

  - delete pkg/brand
  - add check-no-brand-pkg guard (wired into `check`) so it can't reappear

* refactor(ui): stop importing from the app; use own cn util

  pkg/ui pulled `cn` from @/lib/utils (../../app) — an inverted dependency on
  the consuming app. Point the animation components at pkg/ui's own cn and
  drop the @/app, @/registry, @/lib tsconfig path aliases.

* fix(ui): type errors; stop tracking the root lockfile

  - ModelCard: lucide-react dropped the Github icon → use Code
  - drawer: annotate DrawerTrigger/DrawerClose (radix type portability)
  - untrack root pnpm-lock.yaml; CI → --no-frozen-lockfile

* release: bump @hanzo/ui to 5.7.0

* refactor: rename pkg/ → pkgs/, merge packages/ into it

  standardize on 'pkgs/': move pkg/* and packages/* into pkgs/.
  Update workspace globs, CI, scripts, and config references accordingly.
2026-06-19 15:30:30 -10:00

77 lines
2.1 KiB
TypeScript

'use client'
/**
* SuccessStep — shown after a successful topup.
*/
import React from 'react'
export interface SuccessStepProps {
newBalanceCents: number
currency: string
onClose: () => void
}
function formatAmount(cents: number, currency: string): string {
return new Intl.NumberFormat('en-US', {
style: 'currency',
currency: currency.toUpperCase(),
}).format(cents / 100)
}
export function SuccessStep({ newBalanceCents, currency, onClose }: SuccessStepProps) {
return (
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '16px', padding: '24px 0' }}>
<div style={{
width: '56px', height: '56px',
borderRadius: '50%',
backgroundColor: 'rgba(74,222,128,0.12)',
border: '1px solid rgba(74,222,128,0.3)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}>
<CheckIcon />
</div>
<div style={{ textAlign: 'center' }}>
<h3 style={{ fontSize: '18px', fontWeight: '600', color: '#fafafa', margin: '0 0 6px' }}>
Topup Successful
</h3>
<p style={{ fontSize: '14px', color: 'rgba(255,255,255,0.5)', margin: 0 }}>
Your new balance is{' '}
<strong style={{ color: '#fafafa' }}>
{formatAmount(newBalanceCents, currency)}
</strong>
</p>
</div>
<button
type="button"
onClick={onClose}
style={{
marginTop: '8px',
padding: '10px 24px',
borderRadius: '8px',
backgroundColor: 'rgba(255,255,255,0.1)',
color: '#fafafa',
border: '1px solid rgba(255,255,255,0.15)',
fontSize: '14px',
cursor: 'pointer',
transition: 'background-color 0.15s',
}}
>
Close
</button>
</div>
)
}
function CheckIcon() {
return (
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4ade80" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
<polyline points="20 6 9 17 4 12" />
</svg>
)
}