Skip to content

Commit

Permalink
feat: Add link to legacy migration tool post (#8048)
Browse files Browse the repository at this point in the history
* feat: add Migrate from Legacy to onboarding

* fix: move to constants

* feat: update icon
  • Loading branch information
evavirseda authored and begonaalvarezd committed Feb 22, 2024
1 parent 3a0c463 commit c2b0886
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 5 deletions.
3 changes: 3 additions & 0 deletions packages/desktop/features/onboarding.features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ const onboardingFeaturesForIota: IOnboardingFeaturesForNetwork = {
enabled: false,
},
},
migrateFromLegacy: {
enabled: true,
},
}

const IS_ALPHANET_ENABLED = process.env.STAGE !== 'prod'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
<script lang="ts">
import { OnboardingLayout } from '@components'
import { OnboardingType, onboardingProfile, updateOnboardingProfile } from '@contexts/onboarding'
import {
MIGRATE_FROM_LEGACY_LINK,
OnboardingType,
onboardingProfile,
updateOnboardingProfile,
} from '@contexts/onboarding'
import { localize } from '@core/i18n'
import { getNetworkNameFromNetworkId } from '@core/network'
import { NetworkId, getNetworkNameFromNetworkId } from '@core/network'
import { profiles } from '@core/profile'
import features from '@features/features'
import { Animation, OnboardingButton, Text } from '@ui'
import { Animation, OnboardingButton, Text, TextType } from '@ui'
import { onMount } from 'svelte'
import { onboardingRouter } from '../onboarding-router'
import { Icon as IconEnum } from '@auxiliary/icon'
import { AnimationEnum } from '@auxiliary/animation'
import { openUrlInBrowser } from '@core/app'
const networkId = $onboardingProfile?.network?.id
Expand All @@ -22,6 +28,10 @@
$onboardingRouter.previous()
}
function onLegacyMigrationClick(): void {
openUrlInBrowser(MIGRATE_FROM_LEGACY_LINK)
}
onMount(() => {
// Clean up if user has navigated back to this view
updateOnboardingProfile({ onboardingType: undefined })
Expand All @@ -30,7 +40,7 @@

<OnboardingLayout allowBack={$profiles.length > 0 || $onboardingProfile?.isDeveloperProfile} {onBackClick}>
<div slot="title">
<Text type="h2"
<Text type={TextType.h2}
>{localize('views.onboarding.profileSetup.setup.title', {
values: {
network: getNetworkNameFromNetworkId(networkId),
Expand All @@ -39,7 +49,7 @@
>
</div>
<div slot="leftpane__content">
<Text type="p" secondary classes="mb-8"
<Text type={TextType.p} secondary classes="mb-8"
>{localize('views.onboarding.profileSetup.setup.body', {
values: {
network: getNetworkNameFromNetworkId(networkId),
Expand Down Expand Up @@ -82,6 +92,15 @@
disabled={!features?.onboarding?.[networkId]?.claimRewards?.enabled}
onClick={() => onProfileSetupSelectionClick(OnboardingType.Claim)}
/>
{#if networkId === NetworkId.Iota}
<OnboardingButton
primaryText={localize('actions.migrateFromLegacy')}
secondaryText={localize('actions.migrateFromLegacyDescription')}
icon={IconEnum.Sync}
hidden={features?.onboarding?.[networkId]?.[networkId]?.migrateFromLegacy?.enabled}
onClick={onLegacyMigrationClick}
/>
{/if}
</div>
<div slot="rightpane" class="w-full h-full flex justify-center bg-pastel-green dark:bg-gray-900">
<Animation animation={AnimationEnum.SetupDesktop} />
Expand Down
1 change: 1 addition & 0 deletions packages/shared/lib/contexts/onboarding/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * from './shimmer-claiming-account-sync-options.constant'
export * from './temporary-profile-manager-directory-name.constant'
export * from './stronghold-regex.constant'
export * from './shimmer-claim-default-transaction-options.constant'
export * from './migrate-from-legacy-link.constant'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const MIGRATE_FROM_LEGACY_LINK = 'https://blog.iota.org/iota-legacy-migration-tool'
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ export interface IOnboardingFeaturesForNetwork extends IFeatureFlag {
strongholdBackup: IFeatureFlag
ledgerBackup: IFeatureFlag
}
migrateFromLegacy?: IFeatureFlag
}
2 changes: 2 additions & 0 deletions packages/shared/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,8 @@
"createWalletDescription": "Create a fresh profile running on {network, select, iota {Chrysalis} shimmer {Shimmer} testnet {Testnet} custom {Custom Network} other {Unknown}}",
"claimShimmer": "Claim Shimmer staking rewards",
"claimShimmerDescription": "Import IOTA profile and claim staking rewards",
"migrateFromLegacy": "Migrate from Legacy",
"migrateFromLegacyDescription": "Migrate to Stardust",
"createAlias": "Create alias",
"createAliasDescription": "Create alias output",
"savePassword": "Save password",
Expand Down

0 comments on commit c2b0886

Please sign in to comment.