From e18bab5f46e8d1054c544d9719f252d9a61b42e5 Mon Sep 17 00:00:00 2001 From: Dawid Urbas Date: Wed, 3 Jul 2024 17:22:50 +0200 Subject: [PATCH] Fix UI/UX --- .../src/lib/services/key-manager-store.ts | 2 - .../routes/extension-password/+page.svelte | 2 +- .../src/routes/setup-pass/+layout.svelte | 4 +- .../setup-pass/enter-passphrase/+page.svelte | 6 +- .../routes/setup-pass/import-key/+page.svelte | 135 +++++++++--------- .../routes/setup-pass/important/+page.svelte | 27 ++++ .../webapp-extension/setup/+page.svelte | 9 +- .../static/img/exclamation.svg | 5 + .../static/img/noun.svg | 14 -- .../static/img/trash.svg | 3 + .../static/manifest.json | 2 +- holo-key-manager-extension/tailwind.config.js | 3 +- 12 files changed, 116 insertions(+), 96 deletions(-) create mode 100644 holo-key-manager-extension/src/routes/setup-pass/important/+page.svelte create mode 100644 holo-key-manager-extension/static/img/exclamation.svg delete mode 100644 holo-key-manager-extension/static/img/noun.svg create mode 100644 holo-key-manager-extension/static/img/trash.svg diff --git a/holo-key-manager-extension/src/lib/services/key-manager-store.ts b/holo-key-manager-extension/src/lib/services/key-manager-store.ts index 164ee8d..2751f74 100644 --- a/holo-key-manager-extension/src/lib/services/key-manager-store.ts +++ b/holo-key-manager-extension/src/lib/services/key-manager-store.ts @@ -98,8 +98,6 @@ export const getKeys = async (params: GetKeysObjectParams, signature: string) => 'Failed to fetch data object' ); - console.log('response', response); - const json = await response.json(); const data = validateData(GetKeysResponseSchema.array(), json); diff --git a/holo-key-manager-extension/src/routes/extension-password/+page.svelte b/holo-key-manager-extension/src/routes/extension-password/+page.svelte index fabf4f9..9aaf948 100644 --- a/holo-key-manager-extension/src/routes/extension-password/+page.svelte +++ b/holo-key-manager-extension/src/routes/extension-password/+page.svelte @@ -62,7 +62,7 @@ return $createPassword.mutate($passwordStore, { onSuccess: () => { - goto('/setup-pass/enter-passphrase'); + goto('/setup-pass/important'); } }); }} diff --git a/holo-key-manager-extension/src/routes/setup-pass/+layout.svelte b/holo-key-manager-extension/src/routes/setup-pass/+layout.svelte index 91608a3..e304e39 100644 --- a/holo-key-manager-extension/src/routes/setup-pass/+layout.svelte +++ b/holo-key-manager-extension/src/routes/setup-pass/+layout.svelte @@ -8,10 +8,12 @@ $: if ($setupDeviceKeyQuery.data) { dismissWindow(); } + const shouldShowGoBack = (pathname: string): boolean => + !pathname.includes('start') && !pathname.includes('important'); - {#if !$page.url.pathname.includes('start')} + {#if shouldShowGoBack($page.url.pathname)} {/if} diff --git a/holo-key-manager-extension/src/routes/setup-pass/enter-passphrase/+page.svelte b/holo-key-manager-extension/src/routes/setup-pass/enter-passphrase/+page.svelte index 7bc3e6b..8f59e3d 100644 --- a/holo-key-manager-extension/src/routes/setup-pass/enter-passphrase/+page.svelte +++ b/holo-key-manager-extension/src/routes/setup-pass/enter-passphrase/+page.svelte @@ -1,4 +1,6 @@ {#if passphraseState === 'set'} diff --git a/holo-key-manager-extension/src/routes/setup-pass/import-key/+page.svelte b/holo-key-manager-extension/src/routes/setup-pass/import-key/+page.svelte index 8052f9f..3f927eb 100644 --- a/holo-key-manager-extension/src/routes/setup-pass/import-key/+page.svelte +++ b/holo-key-manager-extension/src/routes/setup-pass/import-key/+page.svelte @@ -41,84 +41,79 @@ extraProps="my-4 max-w-xs text-center" text="Please import your device seed file below to recover your Key Manager" /> -
- - {#if fileContent} -
-

+

+
+

Import failed, please try again

+

{fileName}

+
-
-
-
-
-

100%

+ Try again +
- {:else} - Cloud -
-

- Click to import - or drag and drop your seed file -

-
- {/if} - -
- - +
+
+{:else} +
+ { - if ($recoverDeviceKeyMutation.error) { - $recoverDeviceKeyMutation.reset(); - } - }} - /> - {#if $recoverDeviceKeyMutation.error} - - Oops! We couldn't import your device seed. - - Please try again. - {/if} + inputElement={false} + on:drop={handleFilesSelect} + accept=".txt" + multiple={false} + disableDefaultStyles={true} + > + {#if fileContent} +
+

{fileName}

+ Checkbox +
+
+
+
+
+

100%

+
+ {:else} + Cloud +
+

+ Click to import + or drag and drop your seed file +

+
+ {/if} + +
+ + +
-
+{/if}