Skip to content

feat: extract shared AmountInput component from VaultPanel#313

Merged
collinsezedike merged 2 commits into
drydocs:mainfrom
Diyaaa-12:feat/277-amount-input-component
Jul 6, 2026
Merged

feat: extract shared AmountInput component from VaultPanel#313
collinsezedike merged 2 commits into
drydocs:mainfrom
Diyaaa-12:feat/277-amount-input-component

Conversation

@Diyaaa-12

Copy link
Copy Markdown
Contributor

Summary

  • Both the deposit (USDC) and withdraw (mUSDC) tabs in VaultPanel.tsx had 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.
  • Extracted a shared <AmountInput> component (currency, value, onChange, onKeyDown props) in apps/web/src/components/ui/AmountInput.tsx and replaced both blocks in VaultPanel.tsx.
  • Visual appearance and behavior are unchanged — same markup, just consolidated into one reusable component.

Test plan

  • pnpm lint passes
  • pnpm typecheck passes (apps/web)
  • pnpm test — 15 pre-existing failures unrelated to this change (TypeError: storage.setItem is not a function in Zustand's persist middleware, across wallet.test.ts, useWalletConnect.test.ts, useVaultActions.test.ts). Verified via git stash that these fail identically on main without this change — appears to be a missing localStorage mock in the test setup.

Closes #277

@vercel

vercel Bot commented Jul 5, 2026

Copy link
Copy Markdown

@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
@Diyaaa-12 Diyaaa-12 force-pushed the feat/277-amount-input-component branch from 26bd0b2 to 87c2a1a Compare July 5, 2026 19:32
@Diyaaa-12

Copy link
Copy Markdown
Contributor Author

Fixed the formatting on my two changed files (VaultPanel.tsx, AmountInput.tsx) — they now pass pnpm format:check cleanly.

However, I found that pnpm format:check fails repo-wide with 121 unrelated files flagged (mostly line-ending / pre-existing formatting drift unrelated to this PR). I confirmed this exists on main itself too — it's not something introduced by this change. Since the CI job runs prettier --check . unscoped (see .github/workflows/ci.yml:21), the "Lint & Typecheck" check will likely stay red on this PR regardless, through no fault of the actual diff here.

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.

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
meridian Ready Ready Preview, Comment Jul 6, 2026 5:32pm

@collinsezedike

Copy link
Copy Markdown
Collaborator

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 pnpm format:check locally on Windows flags those files as mismatched even though the committed bytes are LF and pass cleanly on CI (Ubuntu). No repo-wide issue to track.

On the test failures: pnpm test passes cleanly on CI. The storage.setItem errors you saw are a local environment issue; jsdom's localStorage stub behaves differently across setups. CI is the authoritative environment here and it is green.

All checks pass. This is good to merge.

@collinsezedike collinsezedike merged commit e31fbdf into drydocs:main Jul 6, 2026
8 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.

[Frontend] Extract shared AmountInput component from VaultPanel deposit and withdraw tabs

2 participants