Skip to content

Commit

Permalink
feat: prepare UI for implicit account creation STEP 1 (#7878)
Browse files Browse the repository at this point in the history
* feat: add account to routes

* feat: add to analytics featureflag

* feat: add account view and multistep

* style: refinements

* feat: rename  files and add locale

* feat: prepare UI step 1

* feat: add locales

* fix: update naming

* feat: update naming and improve code

* fix: move comment

* fix import

* fix: remove accountImplicit route and add to wallet tab

* fix: improve naming

* Update packages/desktop/views/dashboard/wallet/Wallet.svelte

* Update packages/desktop/views/dashboard/wallet/Wallet.svelte

* fix: add router

* minor fixes

* ix: add missing dots

* fix: colors

* fix: remove unnecessary function

* fix: rename files

* fix: move if/else and key block

* fix: reset after finish

---------

Co-authored-by: Begoña Álvarez de la Cruz <balvarez@boxfish.studio>
  • Loading branch information
evavirseda and begonaalvarezd authored Jan 16, 2024
1 parent f49e87e commit d9236db
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 34 deletions.
15 changes: 5 additions & 10 deletions packages/desktop/views/dashboard/wallet/Wallet.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,10 @@

{#if $selectedWallet}
{#key $selectedWallet?.index}
<wallet-container
class="w-full h-full flex flex-nowrap p-8 relative flex-1
bg-gray-50 dark:bg-gray-900 justify-center items-center"
>
{#if hasAccount}
<WalletView />
{:else}
<ImplicitAccountCreationView />
{/if}
</wallet-container>
{#if hasAccount}
<WalletView />
{:else}
<ImplicitAccountCreationView />
{/if}
{/key}
{/if}
48 changes: 26 additions & 22 deletions packages/desktop/views/dashboard/wallet/views/WalletView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,34 @@
import features from '@features/features'
</script>

<div class="h-full grid grid-cols-3 gap-x-4 min-h-0 min-w-0 max-w-7xl">
<div class="flex flex-col space-y-4">
<Pane overflow={Overflow.Visible}>
{#if features?.wallet?.accountSummary?.enabled}
<AccountSummary />
<wallet-container
class="w-full h-full flex flex-nowrap p-8 relative flex-1 bg-gray-50 dark:bg-gray-900 justify-center items-center"
>
<div class="h-full grid grid-cols-3 gap-x-4 min-h-0 min-w-0 max-w-7xl">
<div class="flex flex-col space-y-4">
<Pane overflow={Overflow.Visible}>
{#if features?.wallet?.accountSummary?.enabled}
<AccountSummary />
{/if}
</Pane>
<Pane>
<div class="flex flex-col space-y-6">
{#if features?.wallet?.sendAndReceive?.enabled}
<SendButton />
<ReceiveAddressButton />
{/if}
</div>
</Pane>
</div>
<Pane>
{#if features?.wallet?.assets?.enabled}
<AssetList assets={$selectedWalletAssets} />
{/if}
</Pane>
<Pane>
<div class="flex flex-col space-y-6">
{#if features?.wallet?.sendAndReceive?.enabled}
<SendButton />
<ReceiveAddressButton />
{/if}
</div>
{#if features?.wallet?.activityHistory?.enabled}
<AccountActivity />
{/if}
</Pane>
</div>
<Pane>
{#if features?.wallet?.assets?.enabled}
<AssetList assets={$selectedWalletAssets} />
{/if}
</Pane>
<Pane>
{#if features?.wallet?.activityHistory?.enabled}
<AccountActivity />
{/if}
</Pane>
</div>
</wallet-container>
Original file line number Diff line number Diff line change
@@ -1 +1,75 @@
<h1>OneTimeDeposit</h1>
<script lang="ts">
import { Button, FontWeight, Text, TextType } from 'shared/components'
import { localize } from '@core/i18n'
import { setClipboard } from '@core/utils'
let isVisibleAddress: boolean = false
// TODO: Replace with proper address
const DUMMY_ADDRESS = 'iota1q9f0mlq8yxpx2nck8a0slxnzr4ef2ek8f5gqxlzd0wasgp73utryjtzcp98'
function showAddress() {
isVisibleAddress = true
}
function onCopyClick(): void {
setClipboard(DUMMY_ADDRESS)
}
</script>

<step-content class="flex flex-col items-center justify-between h-full pt-12">
<div class="flex flex-col text-center px-4 space-y-4 max-w-md">
<div class="flex items-center justify-center">
<img
src="assets/illustrations/implicit-account/show-one-time-address.svg"
alt={localize('views.implicit-account-creation.steps.step1.title')}
/>
</div>
<Text type={TextType.h3} fontWeight={FontWeight.semibold}
>{localize('views.implicit-account-creation.steps.step1.view.title')}</Text
>
<Text type={TextType.h5} fontSize="15" color="blue-700" darkColor="blue-700" fontWeight={FontWeight.semibold}
>{localize('views.implicit-account-creation.steps.step1.view.subtitle')}</Text
>
<Text type={TextType.h5} fontWeight={FontWeight.normal} color="gray-700" darkColor="gray-500"
>{localize('views.implicit-account-creation.steps.step1.view.body')}</Text
>
</div>
{#if !isVisibleAddress}
<div class="pb-5">
<div class="flex flex-row items-center space-x-24 bg-yellow-200 rounded-lg px-6 py-7 max-w-lg">
<Text type={TextType.h4} fontWeight={FontWeight.medium} color="yellow-900" darkColor="yellow-900"
>{localize('views.implicit-account-creation.steps.step1.view.hiddenAddress.description')}</Text
>
<Button onClick={showAddress} classes="shrink-0"
>{localize('views.implicit-account-creation.steps.step1.view.hiddenAddress.action')}</Button
>
</div>
</div>
{:else}
<div class="flex flex-col justify-center items-center space-y-3">
<div
class="flex flex-row items-center space-x-20 bg-gray-100 dark:bg-gray-800 rounded-lg px-6 py-4 max-w-lg"
>
<div class="flex flex-col space-y-1">
<Text type={TextType.h5} fontWeight={FontWeight.normal} darkColor="gray-400"
>{localize('views.implicit-account-creation.steps.step1.view.oneTimeAddress.title')}</Text
>
<Text
type={TextType.pre}
fontSize="14"
fontWeight={FontWeight.medium}
color="gray-900"
darkColor="white">{DUMMY_ADDRESS}</Text
>
</div>
<Button outline onClick={onCopyClick} classes="shrink-0"
>{localize('views.implicit-account-creation.steps.step1.view.oneTimeAddress.action')}</Button
>
</div>
<Text type={TextType.h5} fontWeight={FontWeight.normal} color="red-600" darkColor="red-600"
>{localize('views.implicit-account-creation.steps.step1.view.oneTimeAddress.tip')}</Text
>
</div>
{/if}
</step-content>
16 changes: 15 additions & 1 deletion packages/shared/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,21 @@
"steps" : {
"step1": {
"title": "Step 1",
"body": "One-time deposit"
"body": "One-time deposit",
"view": {
"title": "One-time deposit",
"subtitle": "3$ - 15$ recommended",
"body": "Send enough funds to using your one-time address so the account can be generated with low waiting times. The funds are your to use after the account has been created.",
"hiddenAddress": {
"description": "Do not send funds to the address more than once",
"action": "Show Address"
},
"oneTimeAddress": {
"title": "One-time Address",
"action": "Copy",
"tip": "Do not sent fund to this address more than once"
}
}
},
"step2": {
"title": "Step 2",
Expand Down

0 comments on commit d9236db

Please sign in to comment.