fix: update messaging in MigrationZeroBalanceModal for clarity and us…#380
Conversation
📝 WalkthroughWalkthroughUpdated UI copy in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/components/MigrationZeroBalanceModal.tsx`:
- Around line 171-173: Update the ambiguous copy in the
MigrationZeroBalanceModal component: replace "the latest one" in the paragraph
JSX (inside MigrationZeroBalanceModal) with an explicit reference to the new
embedded-wallet address (for example: "your new embedded-wallet address (the
current address displayed in this app)") so users migrating from a
smart-contract wallet know to use the newly generated/embedded wallet address
rather than their old SCW address.
…for improved clarity
… on wallet compatibility
There was a problem hiding this comment.
♻️ Duplicate comments (1)
app/components/MigrationZeroBalanceModal.tsx (1)
171-172: Note copy now resolves the previously flagged ambiguity."your new wallet address" is unambiguous — users migrating from a smart-contract wallet clearly understand which address to update. This addresses the concern raised in the prior review about "the latest one."
The trailing blank line at Line 172 (before
</p>) can also be cleaned up alongside the one at Line 162.✏️ Remove trailing blank line
Note: If you've saved or shared your wallet address elsewhere, make sure to update it to your new wallet address. - </p>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/components/MigrationZeroBalanceModal.tsx` around lines 171 - 172, Remove the unnecessary trailing blank lines in the JSX markup within MigrationZeroBalanceModal: delete the empty lines after the paragraph blocks (the stray blank lines currently at the ends of the <p> elements referenced around lines where the note "Note: If you've saved or shared your wallet address elsewhere..." appears and the earlier paragraph near line 162) so the JSX has no empty lines before the closing </p> tags in the MigrationZeroBalanceModal component.
🧹 Nitpick comments (1)
app/components/MigrationZeroBalanceModal.tsx (1)
155-164: Header and body copy look good.The updated heading and body message are clear and accurately describe the wallet's state post-migration.
The extra blank line at Line 162 (between the last JSX prop and
>) is a harmless artifact but slightly noisy in the diff — consider removing it.✏️ Remove extra blank line
<p className="font-[Inter] text-sm font-light leading-5 tracking-normal text-text-body dark:text-[`#FFFFFFCC`]" - > Your wallet has been successfully set up and is compatible with other on-chain apps.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/components/MigrationZeroBalanceModal.tsx` around lines 155 - 164, In MigrationZeroBalanceModal (the JSX paragraph element inside the rounded-[20px] container), remove the extra blank line between the last prop of the <p> tag and its closing '>' so the opening tag is on one continuous block (i.e., collapse the stray newline before '>') to clean up the JSX formatting.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@app/components/MigrationZeroBalanceModal.tsx`:
- Around line 171-172: Remove the unnecessary trailing blank lines in the JSX
markup within MigrationZeroBalanceModal: delete the empty lines after the
paragraph blocks (the stray blank lines currently at the ends of the <p>
elements referenced around lines where the note "Note: If you've saved or shared
your wallet address elsewhere..." appears and the earlier paragraph near line
162) so the JSX has no empty lines before the closing </p> tags in the
MigrationZeroBalanceModal component.
---
Nitpick comments:
In `@app/components/MigrationZeroBalanceModal.tsx`:
- Around line 155-164: In MigrationZeroBalanceModal (the JSX paragraph element
inside the rounded-[20px] container), remove the extra blank line between the
last prop of the <p> tag and its closing '>' so the opening tag is on one
continuous block (i.e., collapse the stray newline before '>') to clean up the
JSX formatting.
Description
This PR updates Noblocks wallet logic so that users without a smart account (e.g. after smart wallet creation is disabled in Privy) are consistently treated as EOA-only: the app uses and displays their embedded wallet (EOA) for nav, balance, and actions, and they never see any migration flow (banner or zero-balance modal).
Background: With smart wallet creation disabled in Privy, new users only receive an embedded EOA. The app should treat "no smart account" as "use EOA only" and not show migration UI. Existing users who already have a smart wallet continue to see the migration flow and behaviour unchanged.
Changes in
app/hooks/useEIP7702Account.ts(useShouldUseEOA):!hasSmartWallet), the hook now returnstrue(use EOA) instead offalse, so EOA-only users get the correct experience.user == null(Privy still initialising), the hook returnslastValueRef.current ?? falsewithout updating the ref. This avoids corruptinglastValueRefduring init and prevents SCW users from briefly being treated as EOA until balances load. It also centralises init-phase handling in one place.!hasSmartWalletblock: Because the rest of the hook runs only whenuser != null, the innerif (user != null)was removed; when!hasSmartWallet, we setlastValueRef.current = trueand returntrue.Impact:
useWalletMigrationStatusalready prevented banner/modal for this case).Breaking changes: None.
Alternatives considered: Using a DB "user first seen" table to distinguish new vs existing was discussed; this approach relies on Privy configuration (disable smart wallet creation for new users) and a single code path: "no smart account → EOA only," with no new backend or schema.
References
No issue or external references.
Testing
Manual – EOA-only (new user): Log in as a user with no smart wallet in Privy (or an account created after disabling smart wallet creation). Confirm: (1) No migration banner or zero-balance modal; (2) Nav and balance show the embedded (EOA) address; (3) Create order / transfer use the EOA.
Manual – SCW (existing user): Log in as a user with a smart wallet. Confirm: migration banner / zero-balance modal and migration flow behave as before; after migration or with zero SCW balance, EOA is used; no brief EOA flicker during initial load (ready guard).
Regression: Refresh as both EOA-only and SCW users; confirm no console errors and that wallet/balance UI remains correct after load.
Environment: Node / Next.js; standard Noblocks setup.
This change adds test coverage for new/changed/fixed functionality
Checklist
mainBy submitting a PR, I agree to Paycrest's Contributor Code of Conduct and Contribution Guide.
Summary by CodeRabbit