feat: extract shared AmountInput component from VaultPanel#313
Conversation
|
@Diyaaa-12 is attempting to deploy a commit to the Collins' projects Team on Vercel. A member of the Team first needs to authorize it. |
Both the deposit (USDC) and withdraw (mUSDC) tabs in VaultPanel had near-identical amount-input JSX blocks that had to be updated in two places for any styling or behavior change. Extract a shared AmountInput component (currency, value, onChange, onKeyDown props) in apps/web/src/components/ui/AmountInput.tsx and use it in both tabs. Fixes drydocs#277
26bd0b2 to
87c2a1a
Compare
|
Fixed the formatting on my two changed files ( However, I found that Let me know if you'd like me to open a separate issue for the repo-wide formatting drift, or if there's a different way you'd prefer this handled. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Your two files are correctly formatted and CI is green on this PR. On the unrelated files: that is a local Windows artifact. Prettier defaults to LF line endings, but Windows git writes CRLF to the working tree. Running On the test failures: All checks pass. This is good to merge. |
Summary
VaultPanel.tsxhad near-identical amount-input JSX blocks (bordered container, number input, currency badge) that had to be updated in two places for any styling or behavior change.<AmountInput>component (currency,value,onChange,onKeyDownprops) inapps/web/src/components/ui/AmountInput.tsxand replaced both blocks inVaultPanel.tsx.Test plan
pnpm lintpassespnpm typecheckpasses (apps/web)pnpm test— 15 pre-existing failures unrelated to this change (TypeError: storage.setItem is not a functionin Zustand's persist middleware, acrosswallet.test.ts,useWalletConnect.test.ts,useVaultActions.test.ts). Verified viagit stashthat these fail identically onmainwithout this change — appears to be a missing localStorage mock in the test setup.Closes #277