Skip to content

Conversation

@DanielSchiavini
Copy link
Collaborator

@DanielSchiavini DanielSchiavini commented Dec 8, 2025

This change is to merge the loan creation and manage pages for all mint markets

  • until now we had different URLs for creating and managing a loan
  • that meant if you landed in the wrong page you might see a totally wrong image of your loan
  • there were redirects in place from one to the other, but these were complex and buggy
  • instead, we now just look at your wallet, if you have an open loan the page reacts to it, no redirects necessary
  • less complexity, less bugs, less urls, less redirects, less code 🙏 but no change in functionality for the users
  • similar to refactor: merge lend create and manage loan pages #1736
  • depends on refactor: form tabs #1747

@vercel
Copy link

vercel bot commented Dec 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
curve-dapp Ready Ready Preview, Comment Dec 15, 2025 8:04pm
curve-dapp-storybook Ready Ready Preview, Comment Dec 15, 2025 8:04pm

…fi/curve-frontend into refactor/merge-mint-routes
…fi/curve-frontend into refactor/merge-mint-routes
Copy link
Contributor

Copilot AI left a 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 PageMintMarket component that shows create or manage forms based on loanExists state
  • New FormTabs component 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

@DanielSchiavini DanielSchiavini mentioned this pull request Dec 12, 2025
18 tasks
this makes the page consistent with the lend markets in #1736
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.

3 participants