fix(auth): fix named import for Dialog in RequireWallet and add render test - #1656
Conversation
|
@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. |
|
@1nonlypiece please kindly review and merge |
|
@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! 🚀 |
|
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 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 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 |
##closes #1604
Overview
Fixes a runtime import bug in
src/components/auth/RequireWallet.tsxwhereDialogwas being imported as a default export (import Dialog from ...) instead of a named export (import { Dialog } from ...).Since
src/components/ui/Dialog.tsxonly exportsexport function Dialog(...), the previous binding resolved toundefined, 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
src/components/auth/RequireWallet.tsx):import Dialog from '@/components/ui/Dialog'toimport { Dialog } from '@/components/ui/Dialog', bringing it in line with all otherDialogconsumers across the project.src/components/auth/RequireWallet.test.tsxor similar):RequireWalletin its disconnected state to assert that the modal renders without throwing runtime React element type errors.Verification
Dialogimport matches export signature.pnpm test/npm testsuccessfully.pnpm lint/npm run lintcleanly.