diff --git a/infrastructure/eid-wallet/src/lib/fragments/AppNav/AppNav.svelte b/infrastructure/eid-wallet/src/lib/fragments/AppNav/AppNav.svelte index 318bec58..e5cc3743 100644 --- a/infrastructure/eid-wallet/src/lib/fragments/AppNav/AppNav.svelte +++ b/infrastructure/eid-wallet/src/lib/fragments/AppNav/AppNav.svelte @@ -6,8 +6,14 @@ import type { HTMLAttributes } from "svelte/elements"; interface IHeroProps extends HTMLAttributes { title?: string; titleClasses?: string; + iconColor?: string; } -const { title, titleClasses, ...restProps }: IHeroProps = $props(); +const { + title, + titleClasses, + iconColor = "black", + ...restProps +}: IHeroProps = $props(); const baseClasses = "w-full relative flex justify-center h-14 items-center"; @@ -15,7 +21,7 @@ const baseClasses = "w-full relative flex justify-center h-14 items-center"; window.history.back()} /> diff --git a/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.svelte b/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.svelte index 69d07112..44c60354 100644 --- a/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.svelte +++ b/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.svelte @@ -1,5 +1,6 @@ -
+
@@ -55,7 +58,7 @@ $effect(() => {
{:else if variant === 'ePassport'} -

HIGH SECURITY

+

HIGH SECURITY

{:else if variant === 'eVault'} @@ -64,9 +67,9 @@ $effect(() => {
{#if variant === "eName"} -

Your eName

+

Your eName

-

@{userId}

+

@{userId}

{:else if variant === "ePassport"}
@@ -92,7 +95,4 @@ $effect(() => { {/if}
-
- - - \ No newline at end of file + \ No newline at end of file diff --git a/infrastructure/eid-wallet/src/lib/ui/Button/ButtonAction.svelte b/infrastructure/eid-wallet/src/lib/ui/Button/ButtonAction.svelte index 88f8a776..74d512ba 100644 --- a/infrastructure/eid-wallet/src/lib/ui/Button/ButtonAction.svelte +++ b/infrastructure/eid-wallet/src/lib/ui/Button/ButtonAction.svelte @@ -5,7 +5,7 @@ import type { HTMLButtonAttributes } from "svelte/elements"; interface IButtonProps extends HTMLButtonAttributes { variant?: "solid" | "soft" | "danger" | "danger-soft" | "white"; isLoading?: boolean; - callback?: () => Promise; + callback?: () => Promise | void; blockingClick?: boolean; type?: "button" | "submit" | "reset"; size?: "sm" | "md"; @@ -15,6 +15,7 @@ const { variant = "solid", isLoading, callback, + onclick, blockingClick, type = "button", size = "md", diff --git a/infrastructure/eid-wallet/src/lib/ui/Button/ButtonIcon.svelte b/infrastructure/eid-wallet/src/lib/ui/Button/ButtonIcon.svelte index 4e6be406..f998d065 100644 --- a/infrastructure/eid-wallet/src/lib/ui/Button/ButtonIcon.svelte +++ b/infrastructure/eid-wallet/src/lib/ui/Button/ButtonIcon.svelte @@ -6,7 +6,7 @@ import type { HTMLButtonAttributes } from "svelte/elements"; interface IButtonProps extends HTMLButtonAttributes { icon: IconSvgElement; isLoading?: boolean; - callback?: () => Promise; + callback?: () => Promise | void; onclick?: () => void; blockingClick?: boolean; type?: "button" | "submit" | "reset"; diff --git a/infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte b/infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte index 0af52cf9..12ccc1df 100644 --- a/infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte +++ b/infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte @@ -53,17 +53,6 @@ $effect(() => { return () => pane.destroy(); }); - -$effect(() => { - if (isPaneOpen) { - pane.present({ animate: true }); - } else { - pane.destroy({ animate: true }); - } - drawerElem.addEventListener("click_outside", () => { - handleClickOutside(); - }); -});
{ })} onswipe={() => handleSwipe?.(isPaneOpen)} bind:this={drawerElem} - use:clickOutside + use:clickOutside={handleClickOutside} class={cn(restProps.class)} >
diff --git a/infrastructure/eid-wallet/src/lib/utils/clickOutside.ts b/infrastructure/eid-wallet/src/lib/utils/clickOutside.ts index 5c5369fe..f62a3b43 100644 --- a/infrastructure/eid-wallet/src/lib/utils/clickOutside.ts +++ b/infrastructure/eid-wallet/src/lib/utils/clickOutside.ts @@ -1,12 +1,13 @@ /** Dispatch event on click outside of node */ -export const clickOutside = (node: HTMLElement) => { +export const clickOutside = (node: HTMLElement, callback: () => void) => { const handleClick = (event: Event) => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - if (node && !node.contains(event.target) && !event.defaultPrevented) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - node.dispatchEvent(new CustomEvent("click_outside", node)); + if ( + node && + !node.contains(event.target as Node) && + !event.defaultPrevented + ) { + callback(); // Call the provided callback + node.dispatchEvent(new CustomEvent("click_outside")); } }; diff --git a/infrastructure/eid-wallet/src/routes/(app)/+layout.svelte b/infrastructure/eid-wallet/src/routes/(app)/+layout.svelte new file mode 100644 index 00000000..b7c77c23 --- /dev/null +++ b/infrastructure/eid-wallet/src/routes/(app)/+layout.svelte @@ -0,0 +1,20 @@ + + + +{#if currentRoute === "scan-qr"} +
+ dummy scan +
+{/if} + +
+ {@render children()} +
\ No newline at end of file diff --git a/infrastructure/eid-wallet/src/routes/(app)/+page.svelte b/infrastructure/eid-wallet/src/routes/(app)/+page.svelte new file mode 100644 index 00000000..572f85c7 --- /dev/null +++ b/infrastructure/eid-wallet/src/routes/(app)/+page.svelte @@ -0,0 +1,105 @@ + + + + + +{#snippet Section(title: string, children: Snippet)} +
+

{title}

+ {@render children()} +
+{/snippet} + +{#snippet eName()} + alert("View button clicked!")} + shareBtn={() => shareQRdrawerOpen = true} + /> +{/snippet} +{#snippet ePassport()} + goto("/ePassport")} + userData={dummyData} + /> +{/snippet} +{#snippet eVault()} + +{/snippet} + +{@render Section("eName", eName)} +{@render Section("ePassport", ePassport)} +{@render Section("eVault", eVault)} + + +
+
+
+ QR Code +
+ +

Share your eName

+

Anyone scanning this can see your eName

+
+ + Share + +
+
+ + + alert("Action button clicked!")} + class="mx-auto text-nowrap flex gap-8 fixed bottom-5 left-1/2 -translate-x-1/2 z-10" + > + + Scan to Login + + \ No newline at end of file diff --git a/infrastructure/eid-wallet/src/routes/(app)/ePassport/+page.svelte b/infrastructure/eid-wallet/src/routes/(app)/ePassport/+page.svelte new file mode 100644 index 00000000..4ada3866 --- /dev/null +++ b/infrastructure/eid-wallet/src/routes/(app)/ePassport/+page.svelte @@ -0,0 +1,57 @@ + + + + +
+ +
+ {#each Object.entries(secondDummyData) as [fieldName, value] } +
+

{fieldName}

+

{value}

+
+ {/each} +
+
+ + + + Share ePassport + \ No newline at end of file diff --git a/infrastructure/eid-wallet/src/routes/(app)/scan-qr/+page.svelte b/infrastructure/eid-wallet/src/routes/(app)/scan-qr/+page.svelte new file mode 100644 index 00000000..d521efa5 --- /dev/null +++ b/infrastructure/eid-wallet/src/routes/(app)/scan-qr/+page.svelte @@ -0,0 +1,139 @@ + + + + + + + + + + + +

Point the camera at the code

+ +
+ + { codeScannedDrawerOpen = true; }} + /> + (flashlightOn = !flashlightOn)} + /> +
+ + + +
+
+
+ +
+ +

Code scanned!

+

You're trying to access the following site

+ +
+

Website URL

+

https://www.aave.inc/login

+
+
+ { codeScannedDrawerOpen = false; }} + > + Decline + + { + codeScannedDrawerOpen = false + loggedInDrawerOpen = true + }} + > + Confirm + +
+
+ + + +
+
+
+ +
+ +

You're logged in!

+

You're now connected to this service'

+ +
+ { loggedInDrawerOpen = false; }} + > + Close + +
+
+ diff --git a/infrastructure/eid-wallet/src/routes/+page.svelte b/infrastructure/eid-wallet/src/routes/+page.svelte deleted file mode 100644 index 467b9a43..00000000 --- a/infrastructure/eid-wallet/src/routes/+page.svelte +++ /dev/null @@ -1,8 +0,0 @@ - - - await(goto("/onboarding"))}>Onboarding Flow - await(goto("/register"))}>Create PIN - await(goto("/settings"))}>Settings diff --git a/infrastructure/eid-wallet/static/images/dummyQR.png b/infrastructure/eid-wallet/static/images/dummyQR.png new file mode 100644 index 00000000..5d993ffc Binary files /dev/null and b/infrastructure/eid-wallet/static/images/dummyQR.png differ diff --git a/infrastructure/eid-wallet/static/images/dummyScan.png b/infrastructure/eid-wallet/static/images/dummyScan.png new file mode 100644 index 00000000..d001deef Binary files /dev/null and b/infrastructure/eid-wallet/static/images/dummyScan.png differ