From 66109736fab81044a47dd0182b5dea8f3209cb0a Mon Sep 17 00:00:00 2001 From: phoebus-84 <83974413+phoebus-84@users.noreply.github.com> Date: Tue, 16 Jul 2024 05:51:35 +0200 Subject: [PATCH] feat: update didroom-components (#63) --- src/lib/components/tabs/IonTabs.svelte | 56 ++++++------------- src/lib/components/tabs/index.ts | 8 +-- src/routes/+layout.svelte | 4 +- .../(protected)/(tabs)/+layout.svelte | 6 +- .../(protected)/(tabs)/activity/+page.svelte | 5 +- .../(protected)/(tabs)/home/+page.svelte | 47 ++++++++-------- .../[[lang]]/(protected)/(tabs)/home/+page.ts | 4 ++ .../(protected)/(tabs)/profile/+page.svelte | 6 +- 8 files changed, 55 insertions(+), 81 deletions(-) diff --git a/src/lib/components/tabs/IonTabs.svelte b/src/lib/components/tabs/IonTabs.svelte index 689e93b..152efb4 100644 --- a/src/lib/components/tabs/IonTabs.svelte +++ b/src/lib/components/tabs/IonTabs.svelte @@ -1,61 +1,36 @@ - - + - - + {#each tabs as tab} { tabBarClick(tab.tab); }} - aria-hidden - active={currentTabName === tab.tab} + aria-hidden + active={currentTabName === tab.tab} + hasAlert={tab.hasAlert} > {tab.label} diff --git a/src/lib/components/tabs/index.ts b/src/lib/components/tabs/index.ts index c857af5..2d24f94 100644 --- a/src/lib/components/tabs/index.ts +++ b/src/lib/components/tabs/index.ts @@ -1,5 +1,6 @@ export const Tabs = { home: 'home', + wallet: 'wallet', activity: 'activity', profile: 'profile' } as const; @@ -8,13 +9,10 @@ export type Tab = (typeof Tabs)[keyof typeof Tabs]; // -export type IonTabProps = { +export type TabProps = { label: string; tab: Tab; + hasAlert?: boolean; }; // - -import TabPage from './TabPage.svelte'; -import IonTabs from './IonTabs.svelte'; -export { TabPage, IonTabs }; diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 6e0c68f..dfe0270 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -30,11 +30,11 @@ /> diff --git a/src/routes/[[lang]]/(protected)/(tabs)/+layout.svelte b/src/routes/[[lang]]/(protected)/(tabs)/+layout.svelte index 98a7dc6..e9d7cdf 100644 --- a/src/routes/[[lang]]/(protected)/(tabs)/+layout.svelte +++ b/src/routes/[[lang]]/(protected)/(tabs)/+layout.svelte @@ -1,7 +1,9 @@ - +
{#if verifiedSids && verifiedSids.length > 0} {#each verifiedSids.reverse() as verifiedSid} @@ -33,4 +32,4 @@ /> {/if}
-
+ diff --git a/src/routes/[[lang]]/(protected)/(tabs)/home/+page.svelte b/src/routes/[[lang]]/(protected)/(tabs)/home/+page.svelte index 5079f9b..1b6e1ff 100644 --- a/src/routes/[[lang]]/(protected)/(tabs)/home/+page.svelte +++ b/src/routes/[[lang]]/(protected)/(tabs)/home/+page.svelte @@ -1,31 +1,28 @@ - - {#await getVerificationFlows()} - - {:then verificationFlows} - - {m.Verify_credential()} - -
- {#each verificationFlows as vf} - - {/each} -
- {/await} + + + {m.Verify_credential()} + +
+ {#each verificationFlows as vf} + + {/each} +

-
+ diff --git a/src/routes/[[lang]]/(protected)/(tabs)/home/+page.ts b/src/routes/[[lang]]/(protected)/(tabs)/home/+page.ts index fab3058..b591364 100644 --- a/src/routes/[[lang]]/(protected)/(tabs)/home/+page.ts +++ b/src/routes/[[lang]]/(protected)/(tabs)/home/+page.ts @@ -3,6 +3,7 @@ import { r, type Locale } from '$lib/i18n'; import { redirect } from '@sveltejs/kit'; import { getLanguagePreference} from '$lib/preferences/lang'; import { availableLanguageTags } from '$paraglide/runtime'; +import { getVerificationFlows } from '$lib/slangroom/verificationFlows.js'; const getLang = async () => { const lang = await getLanguagePreference(); @@ -15,4 +16,7 @@ export const load = async ({url}) => { if (url.toString().split('/')[3] !== lang) { redirect(301, r('/home', lang)); } + const verificationFlows = await getVerificationFlows() + return { verificationFlows} + }; diff --git a/src/routes/[[lang]]/(protected)/(tabs)/profile/+page.svelte b/src/routes/[[lang]]/(protected)/(tabs)/profile/+page.svelte index f7f53e4..08c223b 100644 --- a/src/routes/[[lang]]/(protected)/(tabs)/profile/+page.svelte +++ b/src/routes/[[lang]]/(protected)/(tabs)/profile/+page.svelte @@ -1,15 +1,13 @@ - +
{user?.name || user?.email} @@ -24,4 +22,4 @@ Logout
-
+