Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughUpdated non-IBAN address field placeholders and revised the street field’s required validation message in DynamicBankAccountForm.tsx. Additionally, a minor formatting change was made in external-accounts action. No logic, control flow, or data submission changes. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Suggested labels
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/components/AddWithdraw/DynamicBankAccountForm.tsx (1)
376-391: Optional UX: add browser autocomplete tokens and use “ZIP Code” placeholder for US.Small polish to improve autofill and locale fit.
Apply:
@@ - {renderInput('street', 'Your Street Address', { + {renderInput('street', 'Your Street Address', { required: 'Street address is required', })} @@ - {renderInput('city', 'Your City', { required: 'City is required' })} + {renderInput('city', 'Your City', { required: 'City is required' })} @@ - {renderInput('state', 'Your State', { + {renderInput('state', 'Your State', { required: 'State is required', })} @@ - {renderInput('postalCode', 'Your Postal Code', { + {renderInput('postalCode', isUs ? 'Your ZIP Code' : 'Your Postal Code', { required: 'Postal code is required', })}Supporting change to enable autofill without touching every call site:
@@ - const renderInput = ( + const renderInput = ( name: keyof IBankAccountDetails, placeholder: string, rules: any, type: string = 'text', rightAdornment?: React.ReactNode, onBlur?: (field: any) => Promise<void> | void - ) => ( + ) => ( <div className="w-full"> <div className="relative"> <Controller name={name} control={control} rules={rules} render={({ field }) => ( <BaseInput {...field} type={type} placeholder={placeholder} className="h-12 w-full rounded-sm border border-n-1 bg-white px-4 text-sm" + autoComplete={ + name === 'street' + ? 'address-line1' + : name === 'city' + ? 'address-level2' + : name === 'state' + ? 'address-level1' + : name === 'postalCode' + ? 'postal-code' + : undefined + } onBlur={async (e) => { // remove any whitespace from the input field // note: @dev not a great fix, this should also be fixed in the backend if (typeof field.value === 'string') { field.onChange(field.value.trim()) } field.onBlur() if (onBlur) { await onBlur(field) } }} /> )} /> </div>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/components/AddWithdraw/DynamicBankAccountForm.tsx(1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1094
File: src/components/AddWithdraw/DynamicBankAccountForm.tsx:279-279
Timestamp: 2025-08-14T08:02:26.705Z
Learning: For hotfixes in the peanut-ui codebase, prefer generic error messages over specific validation error details until the copy can be reviewed with the team, even when the validation functions return detailed error messages.
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1094
File: src/utils/withdraw.utils.ts:181-191
Timestamp: 2025-08-14T14:42:54.411Z
Learning: The countryCodeMap in src/components/AddMoney/consts/index.ts uses uppercase 3-letter country codes as keys (like 'AUT', 'BEL', 'CZE') that map to 2-letter country codes, requiring input normalization to uppercase for proper lookups.
Learnt from: Hugo0
PR: peanutprotocol/peanut-ui#545
File: src/components/Global/GeneralRecipientInput/index.tsx:118-126
Timestamp: 2024-11-26T12:06:11.603Z
Learning: For bank account input fields, use `autocomplete="bank-account-number"` when the recipient type is `'us'` or `'iban'`.
Learnt from: jjramirezn
PR: peanutprotocol/peanut-ui#484
File: src/components/Cashout/Components/Initial.view.tsx:273-274
Timestamp: 2024-10-25T11:33:46.776Z
Learning: In the `InitialCashoutView` component (`src/components/Cashout/Components/Initial.view.tsx`), linked bank accounts should not generate error states, and the `ValidatedInput` component will clear any error messages if needed. Therefore, it's unnecessary to manually clear the error state when selecting or clearing linked bank accounts.
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1094
File: src/components/AddWithdraw/DynamicBankAccountForm.tsx:0-0
Timestamp: 2025-08-13T18:22:01.941Z
Learning: In the DynamicBankAccountForm component, the countryName parameter from useParams will always resemble a country title, not a URL slug.
📚 Learning: 2025-08-14T14:42:54.411Z
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1094
File: src/utils/withdraw.utils.ts:181-191
Timestamp: 2025-08-14T14:42:54.411Z
Learning: The countryCodeMap in src/components/AddMoney/consts/index.ts uses uppercase 3-letter country codes as keys (like 'AUT', 'BEL', 'CZE') that map to 2-letter country codes, requiring input normalization to uppercase for proper lookups.
Applied to files:
src/components/AddWithdraw/DynamicBankAccountForm.tsx
📚 Learning: 2025-08-13T18:22:01.941Z
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1094
File: src/components/AddWithdraw/DynamicBankAccountForm.tsx:0-0
Timestamp: 2025-08-13T18:22:01.941Z
Learning: In the DynamicBankAccountForm component, the countryName parameter from useParams will always resemble a country title, not a URL slug.
Applied to files:
src/components/AddWithdraw/DynamicBankAccountForm.tsx
📚 Learning: 2024-10-25T11:33:46.776Z
Learnt from: jjramirezn
PR: peanutprotocol/peanut-ui#484
File: src/components/Cashout/Components/Initial.view.tsx:273-274
Timestamp: 2024-10-25T11:33:46.776Z
Learning: In the `InitialCashoutView` component (`src/components/Cashout/Components/Initial.view.tsx`), linked bank accounts should not generate error states, and the `ValidatedInput` component will clear any error messages if needed. Therefore, it's unnecessary to manually clear the error state when selecting or clearing linked bank accounts.
Applied to files:
src/components/AddWithdraw/DynamicBankAccountForm.tsx
📚 Learning: 2024-11-26T12:06:11.603Z
Learnt from: Hugo0
PR: peanutprotocol/peanut-ui#545
File: src/components/Global/GeneralRecipientInput/index.tsx:118-126
Timestamp: 2024-11-26T12:06:11.603Z
Learning: For bank account input fields, use `autocomplete="bank-account-number"` when the recipient type is `'us'` or `'iban'`.
Applied to files:
src/components/AddWithdraw/DynamicBankAccountForm.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Deploy-Preview
🔇 Additional comments (1)
src/components/AddWithdraw/DynamicBankAccountForm.tsx (1)
376-391: Approve — address placeholders updated; no action required
Search found "Bank Address" only in src/components/TransactionDetails/TransactionDetailsReceipt.tsx and src/components/AddMoney/components/AddMoneyBankDetails.tsx; those are intentional bank-deposit labels, not user-address copy.
This UI is wrong. It should be the USERS address, not bank address. See this task for more:
https://www.notion.so/peanutprotocol/Bug-Can-t-withdraw-to-US-26b838117579804e856fec94f7a3b9aa?pvs=25
tackles TASK-14753