-
Notifications
You must be signed in to change notification settings - Fork 45
fix: disclaimer tabs reloading the page #972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses the issue of the disclaimer page reloading when a tab is switched by intercepting the Next.js click event and using the native history API to modify the URL.
- Replaces the "tab" prop with "defaultTab" in Disclaimer.tsx and derives the active tab from the URL search parameters.
- Adjusts TabsSwitcher and the various Disclaimer page files (lend, dex, dao, crvusd) to use the new defaultTab prop and removes unnecessary searchParams spread.
- Introduces a utility (pushSearchParams) to update query parameters without triggering a full refresh.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/curve-ui-kit/src/widgets/Disclaimer/Disclaimer.tsx | Changed prop name to defaultTab; uses useSearchParams to override defaultTab if provided. |
| packages/curve-ui-kit/src/utils/urls.ts | Added pushSearchParams utility to update URL search parameters gracefully. |
| packages/curve-ui-kit/src/shared/ui/TabsSwitcher.tsx | Updated mapping of option properties to improve clarity and consistency with the new API. |
| apps/main/src/app/lend/[network]/disclaimer/page.tsx | Updated to use defaultTab prop; removed searchParams spread. |
| apps/main/src/app/dex/[network]/disclaimer/page.tsx | Updated to use defaultTab prop; removed searchParams spread. |
| apps/main/src/app/dao/[network]/disclaimer/page.tsx | Updated to use defaultTab prop; removed searchParams spread. |
| apps/main/src/app/crvusd/[network]/disclaimer/page.tsx | Updated to use defaultTab prop; removed searchParams spread. |
Revert "Merge pull request #972 from curvefi/fix/disclaimer"
This reverts commit 92d525f.
Uh oh!
There was an error while loading. Please reload this page.