Skip to content

Commit

Permalink
feat: update naming and improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
evavirseda committed Jan 4, 2024
1 parent 30a4b81 commit af504e3
Show file tree
Hide file tree
Showing 22 changed files with 33 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { ImplicitAccountCreationRoute, implicitAccountCreationRoute } from '@core/router'
import features from '@features/features'
import { Transition } from 'shared/components'
import { MainView } from './activate'
import { MainView } from './views'
$: if (features.analytics.implicitAccountCreationRoute.enabled && $implicitAccountCreationRoute)
Platform.trackEvent('implicit-account-route', { route: $implicitAccountCreationRoute })
Expand Down
3 changes: 3 additions & 0 deletions packages/desktop/views/implicit-account-creation/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
export { default as ImplicitAccountCreationRouterView } from './ImplicitAccountCreationRouterView.svelte'

export * from './views'
export * from './multi-step'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>AccountCreation</h1>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>FundConfirmation</h1>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">
import { AccountState } from '@contexts/account'
import { ImplicitAccountCreationState } from '@contexts/implicit-account-creation'
const IMPLICIT_ACCOUNT_STEPS: AccountState[] = Object.values(AccountState)
const IMPLICIT_ACCOUNT_STEPS: ImplicitAccountCreationState[] = Object.values(ImplicitAccountCreationState)
let activeState: AccountState | null = null
let activeState: ImplicitAccountCreationState | null = null
let onNext: () => Promise<boolean>
let currentStep: number = 0
let activeComponent
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>OneTimeDeposit</h1>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { default as OneTimeDeposit } from './OneTimeDeposit.svelte'
export { default as FundConfirmation } from './FundConfirmation.svelte'
export { default as AccountCreation } from './AccountCreation.svelte'
export { default as MultiStep } from './MultiStep.svelte'

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { Button, FontWeight, Text, TextType } from 'shared/components'
import { MultiStep } from '../multi-step'
import { MultiStep } from '../../multi-step'
import { localize } from '@core/i18n'
interface IStep {
Expand All @@ -9,23 +9,15 @@
image: string
}
const MAIN_VIEW_STEPS: IStep[] = [
{
title: localize('views.implicit-account.steps.step1.title'),
description: localize('views.implicit-account.steps.step1.body'),
image: 'assets/illustrations/implicit-account/show-one-time-address.svg',
},
{
title: localize('views.implicit-account.steps.step2.title'),
description: localize('views.implicit-account.steps.step2.body'),
image: 'assets/illustrations/implicit-account/generate-mana.svg',
},
{
title: localize('views.implicit-account.steps.step3.title'),
description: localize('views.implicit-account.steps.step3.body'),
image: 'assets/illustrations/implicit-account/sign-transaction.svg',
},
]
const NUMBER_OF_STEPS = Object.keys(localize('views.implicit-account-creation.steps')).length
const MAIN_VIEW_STEPS: IStep[] = new Array(NUMBER_OF_STEPS).fill(null).map((_, index) => {
const stepNumber = index + 1
return {
title: localize(`views.implicit-account-creation.steps.step${stepNumber}.title`),
description: localize(`views.implicit-account-creation.steps.step${stepNumber}.body`),
image: `assets/illustrations/implicit-account-creation/step${stepNumber}.svg`,
}
})
let startProccess = false
Expand All @@ -36,7 +28,7 @@

<section class="flex flex-col w-full h-full pt-5 px-60 pb-12 items-center justify-between">
<box-content class="flex flex-col w-full h-full pt-9 px-8 pb-12 items-center justify-between rounded-2xl">
<Text type={TextType.h2}>{localize('views.implicit-account.title')}</Text>
<Text type={TextType.h2}>{localize('views.implicit-account-creation.title')}</Text>
{#if !startProccess}
<steps-wrapper class="flex space-x-4">
{#each MAIN_VIEW_STEPS as step}
Expand All @@ -55,7 +47,7 @@
</step-content>
{/each}
</steps-wrapper>
<Button onClick={startMultiStepProccess}>{localize('views.implicit-account.action')}</Button>
<Button onClick={startMultiStepProccess}>{localize('views.implicit-account-creation.action')}</Button>
{:else}
<MultiStep />
{/if}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './activate'

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export enum ImplicitAccountCreationState {
ONE_TIME_DEPOSIT = 'OneTimeDeposit',
FUND_CONFIRMATION = 'FundConfirmation',
ACCOUNT_CREATION = 'AccountCreation',
}
2 changes: 1 addition & 1 deletion packages/shared/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@
"body": "From the tokens users received through an IOTA token airdrop, 10% are being available to users immediately at the genesis of the IOTA Stardust network. The rest is gradually unlocked over the course of two years in equal proportion happening every two weeks."
}
},
"implicit-account":{
"implicit-account-creation":{
"title": "Activate Account",
"steps" : {
"step1": {
Expand Down

0 comments on commit af504e3

Please sign in to comment.