-
Notifications
You must be signed in to change notification settings - Fork 45
refactor: merge lend create and manage loan + vault pages #1736
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: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…nto refactor/merge-lend-routes
…nto refactor/merge-lend-routes
…nto refactor/merge-lend-routes
0xPearce
left a comment
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.
|
Great refactor! 🙏 |
The base branch was changed.
…r/merge-lend-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 consolidates the loan creation and management pages into a single unified market page, reducing complexity and eliminating bug-prone redirects. The page now dynamically displays create or manage forms based on whether the user has an existing loan.
Key changes:
- Merged
PageLoanCreateandPageLoanManageinto a singleLendMarketPagecomponent - Simplified routing from
/createand/manageto a single/markets/$marketroute with redirects for backwards compatibility - Consolidated form types, utilities, and styles from separate page directories into shared
PageLendMarketdirectory - Removed complex redirect logic in favor of simple conditional rendering based on
loanExistsstate
Reviewed changes
Copilot reviewed 67 out of 69 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
lend.routes.tsx |
Consolidated routes, added redirects from old /create and /manage URLs to unified market route |
constants.ts |
Updated MARKET_ROUTES to use empty string for PAGE_LOAN instead of separate create/manage routes |
utilsRouter.ts |
Replaced getLoanCreatePathname and getLoanManagePathname with single getLoanPathname |
helpers.ts |
Removed _showNoLoanFound helper (logic now handled in component) |
lend.types.ts |
Added FormStatus type definition for shared use across components |
PageLendMarket/LendMarketPage.tsx |
New unified page component that conditionally renders create or manage tabs based on loan existence |
PageLendMarket/utils.ts |
Consolidated form utilities and constants from both old pages |
PageLendMarket/types.ts |
Merged type definitions from create and manage pages |
PageLendMarket/ManageLoanTabs.tsx |
Updated to receive position details as props instead of computing soft liquidation state |
PageLendMarket/LoanCreateTabs.tsx |
Moved from old PageLoanCreate with updated imports |
PageLendMarket/LoanFormCreate/LoanCreateForm.tsx |
Refactored to remove loan existence checks and redirect logic |
PageLendMarket/Loan* components |
Updated imports from old PageLoanManage paths to new PageLendMarket paths |
components/styles.ts |
Extracted shared styled components from PageLoanManage for reuse |
PageVault/* |
Updated imports to use new shared types and styles locations |
store/* slices |
Updated imports to reference new PageLendMarket paths |
hooks/useMarketDetails.tsx |
Renamed params from llamma/llammaId to market/marketId for consistency |
hooks/useLendPageTitle.ts |
Made prefix parameter optional for unified page title |
BandsComp.tsx |
Changed to use loanExists boolean instead of separate page prop |
MarketInformationComp.tsx |
Removed page prop, now uses loanExists to determine behavior |
| Test files | Updated URL patterns to match new simplified routes |
Comments suppressed due to low confidence (1)
apps/main/src/lend/components/PageLendMarket/LendMarketPage.tsx:168
- The
UserPositionHistorycomponent is being rendered twice when!loanExists:
- Inside the
NoPositionstack (lines 146-152) - Below the conditional rendering (lines 155-168)
This will cause duplicate position history sections to appear on the page when there's no active loan. The second instance (lines 155-168) should likely only render when loanExists is true.
apps/main/src/lend/components/PageLendMarket/LendMarketPage.tsx
Outdated
Show resolved
Hide resolved
this makes the page consistent with the lend markets in #1736
The base branch was changed.
…r/merge-lend-routes
a6062ea


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