-
Notifications
You must be signed in to change notification settings - Fork 44
refactor: merge mint create and manage loan pages #1749
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
base: revert-1745-revert/refactor/routes
Are you sure you want to change the base?
refactor: merge mint create and manage loan pages #1749
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…fi/curve-frontend into refactor/merge-mint-routes
…fi/curve-frontend into refactor/merge-mint-routes
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 refactors the mint market (crvUSD) pages by merging the previously separate loan creation and loan management pages into a single unified page. The key motivation is to eliminate complex and buggy redirects by using wallet state (whether a loan exists) to determine which form to display, rather than relying on URL-based routing.
Key changes:
- Unified
PageMintMarketcomponent that shows create or manage forms based onloanExistsstate - New
FormTabscomponent pattern for tabbed navigation within forms - Consolidated type definitions from separate PageLoanCreate and PageLoanManage into PageMintMarket
Reviewed changes
Copilot reviewed 49 out of 53 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
apps/main/src/routes/crvusd.routes.tsx |
Updated routes to use single market page route and redirect old create/manage URLs |
apps/main/src/loan/components/PageMintMarket/MintMarketPage.tsx |
New unified page component that conditionally renders create or manage tabs based on loan existence |
apps/main/src/loan/components/PageMintMarket/CreateLoanTabs.tsx |
New component that provides tabbed navigation for loan creation |
apps/main/src/loan/components/PageMintMarket/ManageLoanTabs.tsx |
New component that provides tabbed navigation for loan management |
apps/main/src/loan/components/PageMintMarket/types.ts |
Consolidated and reorganized type definitions from separate create/manage pages |
apps/main/src/loan/components/PageMintMarket/utils.ts |
Consolidated utility functions and constants from separate pages |
apps/main/src/loan/components/PageMintMarket/LoanFormCreate/index.tsx |
Moved and updated loan creation form with new initialization hook |
apps/main/src/loan/utils/utilsRouter.ts |
Simplified router utilities, removed create/manage pathname functions, added unified market pathname |
apps/main/src/loan/types/loan.types.ts |
Removed RFormType and simplified CollateralUrlParams to remove formType |
apps/main/src/loan/constants.ts |
Removed unused route constants for create/manage paths |
apps/main/src/loan/store/*.ts |
Updated all store slices to import types from new PageMintMarket location |
apps/main/src/loan/components/PageLoanManage/* |
Deleted old manage page files, moved components to PageMintMarket |
apps/main/src/loan/components/PageLoanCreate/* |
Deleted old create page files, moved components to PageMintMarket |
packages/curve-ui-kit/src/shared/ui/FormTabs/FormTabs.tsx |
Enhanced to support null return values from function-based props |
tests/cypress/support/routes.ts |
Updated test route to use new market URL pattern |
tests/cypress/e2e/llamalend/llamalend-markets.cy.ts |
Updated test regex to match new URL structure |
apps/main/src/llamalend/queries/market-list/llama-markets.ts |
Updated market URL generation to use unified market path |
apps/main/src/loan/components/PageMintMarket/MintMarketPage.tsx
Outdated
Show resolved
Hide resolved
this makes the page consistent with the lend markets in #1736
This change is to merge the loan creation and manage pages for all mint markets