refactor(shell): move WalletCard inline styles to CSS module tokens

Migrate every static inline style={{...}} object (and the inputStyle
const) in WalletCard.tsx to classes in WalletCard.module.css, matching
the file's existing className convention. Exact-matching design tokens
from src/styles/tokens.css are used (8px spacing -> var(--space-2));
values with no exact token match (border-radius 8px, border color
#d0d5dd, font-sizes 12/13/14px, text color #6b7280, max-width 110px)
are kept as literal CSS so rendered output stays pixel-identical,
unchanged from before this refactor.
This commit is contained in:
OmO Orchestrator committed 2026-11-20 19:55:21 -05:00
1 parent c6314061fd
commit a07f35c945
2 files changed
+35 -13

No files matched your search

+30
View File
@@ -61,6 +61,36 @@
color: var(--color-ink);
}
.accountId {
font-size: 12px;
color: #6b7280;
margin-bottom: var(--space-2);
word-break: break-all;
}
.sendRow {
display: flex;
gap: var(--space-2);
margin-bottom: var(--space-2);
}
.input {
flex: 1;
padding: var(--space-2);
border: 1px solid #d0d5dd;
border-radius: 8px;
font-size: 14px;
}
.amountInput {
max-width: 110px;
}
.sendStatus {
font-size: 13px;
margin: 0;
}
/* Compact mode: a slim persistent balance chip for non-home routes - no
* full-bleed hero slab repeated on every mini-app sub-screen, and no
* history panel (the full ledger lives on the home screen). */
+5 -13
View File
@@ -78,14 +78,6 @@ export function WalletCard({ compact = false }: WalletCardProps = {}) {
}
}
const inputStyle = {
flex: 1,
padding: 8,
border: "1px solid #d0d5dd",
borderRadius: 8,
fontSize: 14,
} as const;
return (
<section className={compact ? `${styles.card} ${styles.compact}` : styles.card} aria-label="Wallet">
<div className={styles.header}>
@@ -102,17 +94,17 @@ export function WalletCard({ compact = false }: WalletCardProps = {}) {
{!compact && accountId !== undefined && (
<form className={styles.historyPanel} onSubmit={handleSend}>
<div className={styles.historyHeading}>Send credits</div>
<div style={{ fontSize: 12, color: "#6b7280", marginBottom: 8, wordBreak: "break-all" }}>
<div className={styles.accountId}>
Your ID: <code data-testid="wallet-account-id">{accountId}</code>
</div>
<div style={{ display: "flex", gap: 8, marginBottom: 8 }}>
<div className={styles.sendRow}>
<input
data-testid="wallet-send-recipient"
aria-label="recipient account id"
placeholder="recipient account id"
value={recipient}
onChange={(e) => setRecipient(e.target.value)}
style={inputStyle}
className={styles.input}
/>
<input
data-testid="wallet-send-amount"
@@ -122,14 +114,14 @@ export function WalletCard({ compact = false }: WalletCardProps = {}) {
placeholder="amount"
value={amountInput}
onChange={(e) => setAmountInput(e.target.value)}
style={{ ...inputStyle, maxWidth: 110 }}
className={`${styles.input} ${styles.amountInput}`}
/>
<button type="submit" data-testid="wallet-send-submit">
Send
</button>
</div>
{sendStatus && (
<p data-testid="wallet-send-status" role="status" style={{ fontSize: 13, margin: 0 }}>
<p data-testid="wallet-send-status" role="status" className={styles.sendStatus}>
{sendStatus}
</p>
)}