Skip to content

Commit 92c93b8

Browse files
committed
fix: migrate navigation
1 parent 7896f15 commit 92c93b8

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

pages/v3-migration.page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ export default function V3Migration() {
140140
<Divider sx={{ my: 10 }} />
141141

142142
<MigrationBottomPanel
143-
hfV2Current={user.healthFactor} // TODO: need value
144-
hfV2AfterChange={v2UserSummaryAfterMigration.healthFactor} // TODO: need value
145-
hfV3Current={v3UserSummaryBeforeMigration.healthFactor} // TODO: need value
146-
hfV3AfterChange={v3UserSummaryAfterMigration.healthFactor} // TODO: need value
143+
hfV2Current={user.healthFactor}
144+
hfV2AfterChange={v2UserSummaryAfterMigration.healthFactor}
145+
hfV3Current={v3UserSummaryBeforeMigration.healthFactor}
146+
hfV3AfterChange={v3UserSummaryAfterMigration.healthFactor}
147147
disableButton={
148148
!Object.keys(selectedSupplyAssets).length && !Object.keys(selectedBorrowAssets).length
149149
}

src/locales/en/messages.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ msgstr "Migrate"
10991099
msgid "Migrate from {0} V2 to {1} V3"
11001100
msgstr "Migrate from {0} V2 to {1} V3"
11011101

1102-
#: src/ui-config/menu-items/index.tsx
1102+
#: src/modules/dashboard/DashboardTopPanel.tsx
11031103
msgid "Migrate to V3"
11041104
msgstr "Migrate to V3"
11051105

src/modules/dashboard/DashboardTopPanel.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ import WalletIcon from '../../../public/icons/markets/wallet-icon.svg';
2121
import HALLink from '../../components/HALLink';
2222
import { HealthFactorNumber } from '../../components/HealthFactorNumber';
2323
import { FormattedNumber } from '../../components/primitives/FormattedNumber';
24+
import { Link, ROUTES } from '../../components/primitives/Link';
2425
import { NoData } from '../../components/primitives/NoData';
2526
import { TopInfoPanel } from '../../components/TopInfoPanel/TopInfoPanel';
2627
import { TopInfoPanelItem } from '../../components/TopInfoPanel/TopInfoPanelItem';
2728
import { useAppDataContext } from '../../hooks/app-data-provider/useAppDataProvider';
29+
import { useRootStore } from '../../store/root';
30+
import { selectIsMigrationAvailable } from '../../store/v3MigrationSelectors';
2831
import { LiquidationRiskParametresInfoModal } from './LiquidationRiskParametresModal/LiquidationRiskParametresModal';
2932

3033
export const DashboardTopPanel = () => {
@@ -34,6 +37,8 @@ export const DashboardTopPanel = () => {
3437
const [open, setOpen] = useState(false);
3538
const { openClaimRewards } = useModalContext();
3639

40+
const isMigrateToV3Available = useRootStore((state) => selectIsMigrationAvailable(state));
41+
3742
const theme = useTheme();
3843
const downToSM = useMediaQuery(theme.breakpoints.down('sm'));
3944

@@ -205,6 +210,16 @@ export const DashboardTopPanel = () => {
205210
</Box>
206211
</TopInfoPanelItem>
207212
)}
213+
214+
{isMigrateToV3Available && (
215+
<Box sx={{ alignSelf: 'center' }}>
216+
<Link href={ROUTES.migrationTool}>
217+
<Button variant="gradient">
218+
<Trans>Migrate to V3</Trans>
219+
</Button>
220+
</Link>
221+
</Box>
222+
)}
208223
</TopInfoPanel>
209224

210225
<LiquidationRiskParametresInfoModal

src/ui-config/menu-items/index.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ export const navigation: Navigation[] = [
4545
process.env.NEXT_PUBLIC_ENV === 'prod' &&
4646
!ENABLE_TESTNET,
4747
},
48-
{
49-
link: ROUTES.migrationTool,
50-
title: t`Migrate to V3`,
51-
isVisible: () => true, // TODO: maybe need fix
52-
},
5348
{
5449
link: ROUTES.faucet,
5550
title: t`Faucet`,

0 commit comments

Comments
 (0)