Skip to content

Commit c5649cc

Browse files
authored
Merge pull request #71 from lidofinance/feature/si-1917-routing-changes
Update routing
2 parents 620711e + 253859c commit c5649cc

7 files changed

Lines changed: 18 additions & 26 deletions

File tree

consts/routing.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ export const appPaths = {
88
vault: (vaultAddress: Address) =>
99
({
1010
overview: `/vaults/${vaultAddress}`,
11-
supply: (mode: 'fund' | 'withdraw') =>
12-
`/vaults/${vaultAddress}/supply/${mode}` as const,
13-
adjustment: (mode: 'mint' | 'repay') =>
14-
`/vaults/${vaultAddress}/adjustment/${mode}` as const,
11+
eth: (mode: 'supply' | 'withdraw') =>
12+
`/vaults/${vaultAddress}/eth/${mode}` as const,
13+
steth: (mode: 'mint' | 'repay') =>
14+
`/vaults/${vaultAddress}/steth/${mode}` as const,
1515
claim: `/vaults/${vaultAddress}/claim`,
1616
settings: `/vaults/${vaultAddress}/settings`,
1717
validators: `/vaults/${vaultAddress}/validators`,

features/adjustment/adjustment-tabs.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,11 @@ export const AdjustmentTabs = () => {
1616
// TODO: improve creation of the path
1717
const mintRoutes = [
1818
{
19-
path: appPaths.vaults
20-
.vault(vaultAddress ?? zeroAddress)
21-
.adjustment('mint'),
19+
path: appPaths.vaults.vault(vaultAddress ?? zeroAddress).steth('mint'),
2220
name: 'Mint',
2321
},
2422
{
25-
path: appPaths.vaults
26-
.vault(vaultAddress ?? zeroAddress)
27-
.adjustment('repay'),
23+
path: appPaths.vaults.vault(vaultAddress ?? zeroAddress).steth('repay'),
2824
name: 'Repay',
2925
},
3026
];

features/overview/components/balance/balance.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ const sectionPayloadList: SectionPayload[] = [
77
title: 'Available to withdraw',
88
key: 'withdrawableEth',
99
actionText: 'Withdraw ETH',
10-
actionLink: (vault) => appPaths.vaults.vault(vault).supply('withdraw'),
10+
actionLink: (vault) => appPaths.vaults.vault(vault).eth('withdraw'),
1111
},
1212
{
1313
title: 'Idle capital',
1414
key: 'balanceEth',
1515
actionText: 'Supply ETH',
16-
actionLink: (vault) => appPaths.vaults.vault(vault).supply('fund'),
16+
actionLink: (vault) => appPaths.vaults.vault(vault).eth('supply'),
1717
},
1818
// TODO: add this after the metrics are implemented
1919
// {

features/supply/supply-tabs.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,21 @@ import { Withdraw } from './withdraw';
88
import { Switch } from 'shared/components/switch';
99
import { appPaths } from 'consts/routing';
1010
import { zeroAddress } from 'viem';
11-
export interface SupplyTabProps {
12-
mode: 'fund' | 'withdraw';
13-
}
11+
export type SupplyTabProps = {
12+
mode: 'supply' | 'withdraw';
13+
};
1414

1515
export const SupplyTabs: FC<SupplyTabProps> = ({ mode }) => {
16-
const isFundTab = mode === 'fund';
16+
const isFundTab = mode === 'supply';
1717
const { vaultAddress } = useVaultInfo();
1818

1919
const supplyRoutes = [
2020
{
21-
path: appPaths.vaults.vault(vaultAddress ?? zeroAddress).supply('fund'),
21+
path: appPaths.vaults.vault(vaultAddress ?? zeroAddress).eth('supply'),
2222
name: 'Supply',
2323
},
2424
{
25-
path: appPaths.vaults
26-
.vault(vaultAddress ?? zeroAddress)
27-
.supply('withdraw'),
25+
path: appPaths.vaults.vault(vaultAddress ?? zeroAddress).eth('withdraw'),
2826
name: 'Withdraw',
2927
},
3028
];

pages/vaults/[vaultAddress]/supply/[mode].tsx renamed to pages/vaults/[vaultAddress]/eth/[mode].tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import { SupplyTabs } from 'features/supply';
77
import { useRouter } from 'next/router';
88

99
type SupplyModePageParams = {
10-
mode: 'fund' | 'withdraw';
10+
mode: 'supply' | 'withdraw';
1111
address: Address;
1212
};
1313

1414
const Supply: FC = () => {
1515
const { mode } = useRouter().query as SupplyModePageParams;
16-
const title = mode === 'fund' ? 'Supply' : 'Withdraw';
16+
const title = mode === 'supply' ? 'Supply' : 'Withdraw';
1717

1818
return (
1919
<Layout navigationMode="vault" title={title} containerSize="content">
File renamed without changes.

shared/components/layout/navigation/modes/vault.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@ const vaultRoutes = (vaultAddress: Address, overrideMode?: any) => [
1919
},
2020
{
2121
title: 'Supply/Withdraw',
22-
path: appPaths.vaults.vault(vaultAddress).supply(overrideMode ?? 'fund'),
22+
path: appPaths.vaults.vault(vaultAddress).eth(overrideMode ?? 'supply'),
2323
icon: <Stake />,
2424
exact: true,
2525
},
2626
{
2727
title: 'Mint/Repay stETH',
28-
path: appPaths.vaults
29-
.vault(vaultAddress)
30-
.adjustment(overrideMode ?? 'mint'),
28+
path: appPaths.vaults.vault(vaultAddress).steth(overrideMode ?? 'mint'),
3129
icon: <Withdraw />,
3230
exact: true,
3331
},

0 commit comments

Comments
 (0)