diff --git a/src/lib/components/icons/logout.svelte b/src/lib/components/icons/logout.svelte new file mode 100644 index 0000000..663275e --- /dev/null +++ b/src/lib/components/icons/logout.svelte @@ -0,0 +1,18 @@ + + + + + + diff --git a/src/lib/components/icons/undo.svelte b/src/lib/components/icons/undo.svelte new file mode 100644 index 0000000..100d9e1 --- /dev/null +++ b/src/lib/components/icons/undo.svelte @@ -0,0 +1,15 @@ + + + + + diff --git a/src/lib/routes.ts b/src/lib/routes.ts index d12e1f5..0c22d07 100644 --- a/src/lib/routes.ts +++ b/src/lib/routes.ts @@ -2,6 +2,7 @@ export const ROUTES = { HOME: '/', PROFILE: '/profile', PROFILE_ADDRESS: (address: string) => `/profile/${address}`, - PROFILE_NEW: '/profile/new', + IDENTITY: '/identity', + IDENTITY_NEW: '/identity/new', POST_NEW: '/post/new', } diff --git a/src/lib/stores/profile.ts b/src/lib/stores/profile.ts index 5ed261b..184332c 100644 --- a/src/lib/stores/profile.ts +++ b/src/lib/stores/profile.ts @@ -2,7 +2,9 @@ import { writable, type Writable } from 'svelte/store' import type { User } from './user' export interface Profile { - key?: boolean // FIXME: this will need to change + key?: { + publicKey: string + } profiles: User[] active?: User } diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 160a7b8..97d0229 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -18,7 +18,7 @@
{#if $profile.active !== undefined}
- + goto(ROUTES.PROFILE)} /> Share freely...
- {:else if $profile.key === true} + {:else if $profile.key?.publicKey !== undefined}
+
+ {#if $profile.key} + {#each $profile.profiles as p} + + {/each} +
+ + diff --git a/src/routes/profile/new/+page.svelte b/src/routes/identity/new/+page.svelte similarity index 88% rename from src/routes/profile/new/+page.svelte rename to src/routes/identity/new/+page.svelte index 9e5a93c..ab60da0 100644 --- a/src/routes/profile/new/+page.svelte +++ b/src/routes/identity/new/+page.svelte @@ -5,11 +5,10 @@ import Input from '$lib/components/input.svelte' import InputFile from '$lib/components/input-file.svelte' import Image from '$lib/components/icons/image.svelte' + import Renew from '$lib/components/icons/renew.svelte' import InputString from '$lib/components/input-string.svelte' import { profile } from '$lib/stores/profile' import { formatAddress } from '$lib/utils' - import { goto } from '$app/navigation' - import { ROUTES } from '$lib/routes' const generateRandomHex = (size: number) => `0x${[...Array(size)].map(() => Math.floor(Math.random() * 16).toString(16)).join('')}` @@ -28,7 +27,7 @@

Create identity

-
@@ -43,8 +42,10 @@
{#if image !== undefined} {file?.name} + + {:else} + {/if} -
{#if file !== undefined} {file.name} @@ -60,7 +61,7 @@ on:click={() => { const user = { address, name, avatar: image } $profile.profiles = [...$profile.profiles, user] - goto(ROUTES.PROFILE) + history.back() }} />
diff --git a/src/routes/post/new/+page.svelte b/src/routes/post/new/+page.svelte index 89a49ca..50ae4ef 100644 --- a/src/routes/post/new/+page.svelte +++ b/src/routes/post/new/+page.svelte @@ -36,7 +36,7 @@ goto(ROUTES.PROFILE)} />
{$profile.active?.name}
{$profile.active?.address}
-