Skip to content

Conversation

@DanielSchiavini
Copy link
Collaborator

@DanielSchiavini DanielSchiavini commented Nov 20, 2025

@vercel
Copy link

vercel bot commented Nov 20, 2025

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

Project Deployment Preview Comments Updated (UTC)
curve-dapp Ready Ready Preview Comment Nov 21, 2025 3:04pm
curve-dapp-storybook Ready Ready Preview Comment Nov 21, 2025 3:04pm

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 loan creation components to make them more generic and reusable for other loan management forms. The main changes include renaming BorrowTabContents to CreateLoanForm, extracting common form components into a widgets/manage-loan directory, and simplifying the gas estimation query structure to return single values instead of nested objects.

Key changes:

  • Renamed components and feature flags for clarity (BorrowTabContentsCreateLoanForm, useBorrowUnifiedFormuseCreateLoanMuiForm)
  • Created generic, reusable loan form widgets: LoanFormWrapper, LoanFormTokenInput, LoanFormAlerts, LoanInfoAccordion, and InputDivider
  • Simplified gas estimation queries to return direct values instead of wrapped objects, making them more consistent with the Query<T> pattern

Reviewed Changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/cypress/component/llamalend/borrow-tab-contents.rpc.cy.tsx Updated test to use renamed CreateLoanForm component and new test IDs
packages/curve-ui-kit/src/hooks/useFeatureFlags.ts Renamed feature flag from useBorrowUnifiedForm to useCreateLoanMuiForm with updated comment
apps/main/src/loan/components/PageLoanCreate/index.tsx Updated to use renamed component and feature flag
apps/main/src/lend/components/PageLoanCreate/index.tsx Updated to use renamed component and feature flag
apps/main/src/llamalend/widgets/manage-loan/loan.types.ts Added generic Query<T> type for consistent query result handling
apps/main/src/llamalend/widgets/manage-loan/LoanLeverageActionInfo.tsx New component extracting leverage-specific action info display
apps/main/src/llamalend/widgets/manage-loan/LoanInfoAccordion.tsx New generic accordion component for displaying loan information
apps/main/src/llamalend/widgets/manage-loan/LoanFormWrapper.tsx New wrapper component for loan forms with FormProvider and consistent styling
apps/main/src/llamalend/widgets/manage-loan/LoanFormTokenInput.tsx New generic token input component for loan forms with type-safe field names
apps/main/src/llamalend/widgets/manage-loan/LoanFormAlerts.tsx New generic alerts component for loan forms with configurable error handling
apps/main/src/llamalend/widgets/InputDivider.tsx New divider component moved from feature to shared widgets
apps/main/src/llamalend/queries/repay/repay-gas-estimate.query.ts Simplified to return single gas value instead of wrapped object
apps/main/src/llamalend/queries/remove-collateral/remove-collateral-gas-estimate.query.ts Simplified to return single gas value instead of wrapped object
apps/main/src/llamalend/queries/create-loan/create-loan-approve-estimate-gas.query.ts Simplified to return single gas value and added error handling
apps/main/src/llamalend/queries/add-collateral/add-collateral-gas-estimate.query.ts Simplified to return single gas value instead of wrapped object
apps/main/src/llamalend/hooks/useEstimateGas.ts Refactored to accept single estimate value and return error information
apps/main/src/llamalend/features/borrow/components/CreateLoanInfoAccordion.tsx New component adapting generic LoanInfoAccordion for create loan use case
apps/main/src/llamalend/features/borrow/components/CreateLoanForm.tsx Renamed from BorrowTabContents and refactored to use generic widgets
apps/main/src/llamalend/features/borrow/components/BorrowTabContents.tsx Removed (renamed to CreateLoanForm)
apps/main/src/llamalend/features/borrow/components/BorrowLeverageActionInfos.tsx Removed (replaced by generic LoanLeverageActionInfo)
apps/main/src/llamalend/features/borrow/components/BorrowFormTokenInput.tsx Removed (replaced by generic LoanFormTokenInput)
apps/main/src/llamalend/features/borrow/components/BorrowFormAlert.tsx Removed (replaced by generic LoanFormAlerts)
apps/main/src/llamalend/features/borrow/components/BorrowActionInfoAccordion.tsx Removed (replaced by CreateLoanInfoAccordion + generic LoanInfoAccordion)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@DanielSchiavini DanielSchiavini changed the base branch from feat/max-borrow to feat/forms November 20, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants