Skip to content

Commit 0f4f08b

Browse files
fix: add leverage tab in beta mode
1 parent 40c87f6 commit 0f4f08b

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

apps/main/src/lend/components/PageLoanManage/LoanBorrowMore/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ import { SizesAndSpaces } from '@ui-kit/themes/design/1_sizes_spaces'
4141

4242
const { Spacing } = SizesAndSpaces
4343

44+
export type LoanBorrowMoreProps = PageContentProps & { isLeverage?: boolean }
45+
4446
const LoanBorrowMore = ({
4547
rChainId,
4648
rOwmId,
@@ -49,9 +51,7 @@ const LoanBorrowMore = ({
4951
market,
5052
userActiveKey,
5153
isLeverage = false,
52-
}: PageContentProps & {
53-
isLeverage?: boolean
54-
}) => {
54+
}: LoanBorrowMoreProps) => {
5555
const isSubscribed = useRef(false)
5656
const activeKey = useStore((state) => state.loanBorrowMore.activeKey)
5757
const activeKeyMax = useStore((state) => state.loanBorrowMore.activeKeyMax)
@@ -442,7 +442,7 @@ export default LoanBorrowMore
442442
/**
443443
* The new implementation of LoanBorrowMore with mui isn't ready yet. For now, we wrap the old one for styling.
444444
*/
445-
export const LoanBorrowMoreWrapped = (props: PageContentProps) => (
445+
export const LoanBorrowMoreWrapped = (props: LoanBorrowMoreProps) => (
446446
<Stack sx={{ backgroundColor: (t) => t.design.Layer[1].Fill }}>
447447
<AppFormContentWrapper>
448448
<LoanBorrowMore {...props} />

apps/main/src/lend/components/PageLoanManage/ManageLoanTabs.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ const LendManageNewMenu = [
7474
{ value: 'remove', label: t`Remove`, component: LoanRemoveCollateralTab },
7575
],
7676
},
77+
{
78+
value: 'leverage',
79+
label: t`Leverage`,
80+
visible: ({ market }) => market?.leverage?.hasLeverage(),
81+
component: (props) => <LoanBorrowMoreWrapped {...props} isLeverage />,
82+
},
7783
] satisfies FormTab<ManageLoanProps>[]
7884

7985
const LendManageSoftLiquidationMenu = [

packages/curve-ui-kit/src/shared/ui/FormTabs/FormTabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function FormTabs<T extends object>({ shouldWrap, ...options }: UseFormTa
9797
>
9898
<TabsSwitcher variant="contained" size="medium" value={tab.value} options={tabs} onChange={onChangeTab} />
9999

100-
{subTab && (
100+
{subTab && subTabs.length > 1 && (
101101
<TabsSwitcher
102102
variant="underlined"
103103
size="small"

0 commit comments

Comments
 (0)