Skip to content

fix(auth): fix named import for Dialog in RequireWallet and add render test - #1656

Merged
1nonlypiece merged 5 commits into
Commitlabs-Org:masterfrom
Olasunkanmi975:fix/require-wallet-dialog-import
Jul 30, 2026
Merged

fix(auth): fix named import for Dialog in RequireWallet and add render test#1656
1nonlypiece merged 5 commits into
Commitlabs-Org:masterfrom
Olasunkanmi975:fix/require-wallet-dialog-import

Conversation

@Olasunkanmi975

Copy link
Copy Markdown
Contributor

##closes #1604

Overview

Fixes a runtime import bug in src/components/auth/RequireWallet.tsx where Dialog was being imported as a default export (import Dialog from ...) instead of a named export (import { Dialog } from ...).

Since src/components/ui/Dialog.tsx only exports export function Dialog(...), the previous binding resolved to undefined, causing React to throw an "Element type is invalid: expected a string... but got: undefined" error whenever the disconnected-wallet modal attempted to render.

Changes Included

  • Import Fix (src/components/auth/RequireWallet.tsx):
    • Corrected import Dialog from '@/components/ui/Dialog' to import { Dialog } from '@/components/ui/Dialog', bringing it in line with all other Dialog consumers across the project.
  • Test Suite (src/components/auth/RequireWallet.test.tsx or similar):
    • Added a unit test rendering RequireWallet in its disconnected state to assert that the modal renders without throwing runtime React element type errors.

Verification

  • Verified Dialog import matches export signature.
  • Added disconnected-state render test passes.
  • Ran pnpm test / npm test successfully.
  • Ran pnpm lint / npm run lint cleanly.

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

@Olasunkanmi975 is attempting to deploy a commit to the 1nonly's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Olasunkanmi975

Copy link
Copy Markdown
Contributor Author

@1nonlypiece please kindly review and merge

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@Olasunkanmi975 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@1nonlypiece

Copy link
Copy Markdown
Contributor

Thanks for the fix! Unfortunately this PR can no longer be merged automatically: master has since gained a completely independent, parallel implementation of the wallet auth guard (PR #1701, "Add wallet auth guard to protected routes"). That change replaced src/components/auth/RequireWallet.tsx and src/components/auth/ProtectedRouteLayout.tsx with a different design (named exports, a redirectTo prop, useWallet from src/hooks/useWallet, a new src/components/auth/index.ts barrel, docs/ROUTE_AUTH_GUARD.md, and its own __tests__/auth/wallet-guard.test.tsx), whereas this PR's branch builds on the older default-export version backed by a new WalletProvider.tsx context and the Dialog component from @/components/ui/Dialog.

The two implementations are architecturally incompatible (different export styles, different prop APIs, different state-management approach), so the merge produces add/add conflicts on both RequireWallet.tsx and ProtectedRouteLayout.tsx that can't be safely auto-resolved — picking either side would silently discard a full, already-merged feature (and, if we kept your version, would break the layouts in commitments/, create/, and settings/ plus the existing wallet-guard.test.tsx that master already relies on).

Since this touches the auth guard directly, I don't want to guess at which implementation should win. Could you rebase this fix on top of current master's RequireWallet.tsx/ProtectedRouteLayout.tsx (from #1701) and re-apply the named-import fix against that version? Happy to take another pass once it's rebased. Skipping the automated conflict resolution for now.

@1nonlypiece
1nonlypiece merged commit 57182b2 into Commitlabs-Org:master Jul 30, 2026
2 of 12 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.

RequireWallet.tsx default-imports Dialog, but Dialog.tsx only has a named export — renders undefined

2 participants