|
1 | 1 | <script lang="ts">
|
2 | 2 | import { OnboardingLayout } from '@components'
|
3 |
| - import { OnboardingType, onboardingProfile, updateOnboardingProfile } from '@contexts/onboarding' |
| 3 | + import { |
| 4 | + MIGRATE_FROM_LEGACY_LINK, |
| 5 | + OnboardingType, |
| 6 | + onboardingProfile, |
| 7 | + updateOnboardingProfile, |
| 8 | + } from '@contexts/onboarding' |
4 | 9 | import { localize } from '@core/i18n'
|
5 |
| - import { getNetworkNameFromNetworkId } from '@core/network' |
| 10 | + import { NetworkId, getNetworkNameFromNetworkId } from '@core/network' |
6 | 11 | import { profiles } from '@core/profile'
|
7 | 12 | import features from '@features/features'
|
8 |
| - import { Animation, OnboardingButton, Text } from '@ui' |
| 13 | + import { Animation, OnboardingButton, Text, TextType } from '@ui' |
9 | 14 | import { onMount } from 'svelte'
|
10 | 15 | import { onboardingRouter } from '../onboarding-router'
|
11 | 16 | import { Icon as IconEnum } from '@auxiliary/icon'
|
12 | 17 | import { AnimationEnum } from '@auxiliary/animation'
|
| 18 | + import { openUrlInBrowser } from '@core/app' |
13 | 19 |
|
14 | 20 | const networkId = $onboardingProfile?.network?.id
|
15 | 21 |
|
|
22 | 28 | $onboardingRouter.previous()
|
23 | 29 | }
|
24 | 30 |
|
| 31 | + function onLegacyMigrationClick(): void { |
| 32 | + openUrlInBrowser(MIGRATE_FROM_LEGACY_LINK) |
| 33 | + } |
| 34 | +
|
25 | 35 | onMount(() => {
|
26 | 36 | // Clean up if user has navigated back to this view
|
27 | 37 | updateOnboardingProfile({ onboardingType: undefined })
|
|
30 | 40 |
|
31 | 41 | <OnboardingLayout allowBack={$profiles.length > 0 || $onboardingProfile?.isDeveloperProfile} {onBackClick}>
|
32 | 42 | <div slot="title">
|
33 |
| - <Text type="h2" |
| 43 | + <Text type={TextType.h2} |
34 | 44 | >{localize('views.onboarding.profileSetup.setup.title', {
|
35 | 45 | values: {
|
36 | 46 | network: getNetworkNameFromNetworkId(networkId),
|
|
39 | 49 | >
|
40 | 50 | </div>
|
41 | 51 | <div slot="leftpane__content">
|
42 |
| - <Text type="p" secondary classes="mb-8" |
| 52 | + <Text type={TextType.p} secondary classes="mb-8" |
43 | 53 | >{localize('views.onboarding.profileSetup.setup.body', {
|
44 | 54 | values: {
|
45 | 55 | network: getNetworkNameFromNetworkId(networkId),
|
|
82 | 92 | disabled={!features?.onboarding?.[networkId]?.claimRewards?.enabled}
|
83 | 93 | onClick={() => onProfileSetupSelectionClick(OnboardingType.Claim)}
|
84 | 94 | />
|
| 95 | + {#if networkId === NetworkId.Iota} |
| 96 | + <OnboardingButton |
| 97 | + primaryText={localize('actions.migrateFromLegacy')} |
| 98 | + secondaryText={localize('actions.migrateFromLegacyDescription')} |
| 99 | + icon={IconEnum.Sync} |
| 100 | + hidden={features?.onboarding?.[networkId]?.[networkId]?.migrateFromLegacy?.enabled} |
| 101 | + onClick={onLegacyMigrationClick} |
| 102 | + /> |
| 103 | + {/if} |
85 | 104 | </div>
|
86 | 105 | <div slot="rightpane" class="w-full h-full flex justify-center bg-pastel-green dark:bg-gray-900">
|
87 | 106 | <Animation animation={AnimationEnum.SetupDesktop} />
|
|
0 commit comments