Skip to content

Commit cc975a5

Browse files
committed
fix: ux issues
1 parent 5485dc6 commit cc975a5

File tree

7 files changed

+215
-181
lines changed

7 files changed

+215
-181
lines changed

infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ const baseClasses = `relative ${variant === "eName" ? "bg-black-900" : variant =
6767
className="text-secondary"
6868
icon={CheckmarkBadge02Icon}
6969
/>
70-
<Button.Icon
70+
<Button.Icon
7171
icon={Copy01Icon}
72-
iconColor={"white"}
73-
strokeWidth={2}
72+
iconColor={"white"}
73+
strokeWidth={2}
7474
onclick={async () => {
7575
if (userId) {
7676
try {
@@ -82,7 +82,7 @@ const baseClasses = `relative ${variant === "eName" ? "bg-black-900" : variant =
8282
}
8383
}
8484
}}
85-
/>
85+
/>
8686
{:else if variant === "ePassport"}
8787
<p
8888
class="bg-white text-black flex items-center leading-0 justify-center rounded-full h-7 px-5 text-xs font-medium"

infrastructure/eid-wallet/src/lib/ui/Drawer/Drawer.svelte

Lines changed: 9 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ interface IDrawerProps extends HTMLAttributes<HTMLDivElement> {
1111
children?: Snippet;
1212
handleSwipe?: (isOpen: boolean | undefined) => void;
1313
dismissible?: boolean;
14-
fullScreen?: boolean;
1514
}
1615
1716
let drawerElem: HTMLDivElement;
@@ -22,7 +21,6 @@ let {
2221
children = undefined,
2322
handleSwipe,
2423
dismissible = true,
25-
fullScreen = false,
2624
...restProps
2725
}: IDrawerProps = $props();
2826
@@ -50,20 +48,11 @@ const swipe = swipeResult.swipe as any;
5048
// isPaneOpen = false;
5149
// };
5250
53-
// Initialize pane - destroy and recreate when fullScreen changes
51+
// Initialize pane
5452
$effect(() => {
5553
if (!drawerElem) return;
5654
57-
// Destroy existing pane if it exists
58-
if (pane) {
59-
pane.destroy();
60-
}
61-
62-
const screenHeight = window.innerHeight;
63-
const fullScreenHeight = Math.floor(screenHeight * 0.8); // 80vh
64-
6555
pane = new CupertinoPane(drawerElem, {
66-
fitHeight: fullScreen,
6756
backdrop: true,
6857
backdropOpacity: dismissible ? 0.5 : 0.8,
6958
backdropBlur: true,
@@ -77,31 +66,12 @@ $effect(() => {
7766
isPaneOpen = false;
7867
},
7968
},
80-
breaks: fullScreen
81-
? {
82-
top: { enabled: true, height: fullScreenHeight },
83-
}
84-
: {
85-
bottom: { enabled: true, height: 250 },
86-
},
87-
initialBreak: fullScreen ? "top" : "bottom",
69+
breaks: {
70+
bottom: { enabled: true, height: 250 },
71+
},
72+
initialBreak: "bottom",
8873
});
8974
90-
// Add class to pane element based on fullScreen prop
91-
// Use setTimeout to ensure pane element is created
92-
setTimeout(() => {
93-
const paneElement = document.querySelector(".pane") as HTMLElement;
94-
if (paneElement) {
95-
if (fullScreen) {
96-
paneElement.classList.add("drawer-fullscreen");
97-
paneElement.classList.remove("drawer-normal");
98-
} else {
99-
paneElement.classList.add("drawer-normal");
100-
paneElement.classList.remove("drawer-fullscreen");
101-
}
102-
}
103-
}, 0);
104-
10575
return () => {
10676
if (pane) {
10777
pane.destroy();
@@ -114,53 +84,7 @@ $effect(() => {
11484
if (!pane || !drawerElem) return;
11585
11686
if (isPaneOpen) {
117-
// Ensure pane exists before presenting
118-
if (!pane.pane || !document.querySelector(".pane")) {
119-
// Recreate pane if it was destroyed
120-
const screenHeight = window.innerHeight;
121-
const fullScreenHeight = Math.floor(screenHeight * 0.8);
122-
pane.destroy();
123-
pane = new CupertinoPane(drawerElem, {
124-
fitHeight: fullScreen,
125-
backdrop: true,
126-
backdropOpacity: dismissible ? 0.5 : 0.8,
127-
backdropBlur: true,
128-
bottomClose: dismissible,
129-
buttonDestroy: false,
130-
showDraggable: dismissible,
131-
upperThanTop: true,
132-
events: {
133-
onBackdropTap: () => {
134-
pane?.destroy();
135-
isPaneOpen = false;
136-
},
137-
},
138-
breaks: fullScreen
139-
? {
140-
top: { enabled: true, height: fullScreenHeight },
141-
}
142-
: {
143-
bottom: { enabled: true, height: 250 },
144-
},
145-
initialBreak: fullScreen ? "top" : "bottom",
146-
});
147-
}
148-
14987
pane.present({ animate: true });
150-
151-
// Update class after presenting
152-
setTimeout(() => {
153-
const paneEl = document.querySelector(".pane") as HTMLElement;
154-
if (paneEl) {
155-
if (fullScreen) {
156-
paneEl.classList.add("drawer-fullscreen");
157-
paneEl.classList.remove("drawer-normal");
158-
} else {
159-
paneEl.classList.add("drawer-normal");
160-
paneEl.classList.remove("drawer-fullscreen");
161-
}
162-
}
163-
}, 0);
16488
} else {
16589
// Don't destroy, just hide - this keeps the pane available
16690
if (pane.pane) {
@@ -174,7 +98,7 @@ $effect(() => {
17498
{...restProps}
17599
use:swipe
176100
bind:this={drawerElem}
177-
class={cn(restProps.class, fullScreen ? "drawer-fullscreen" : "drawer-normal")}
101+
class={cn(restProps.class)}
178102
>
179103
<div class="px-6">
180104
{@render children?.()}
@@ -187,13 +111,9 @@ $effect(() => {
187111
left: 50% !important;
188112
transform: translateX(-50%) !important;
189113
background-color: var(--color-white) !important;
190-
overflow-y: auto !important; /* vertical scroll if needed */
191-
overflow-x: hidden !important; /* prevent sideways scroll */
192-
-webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
193-
}
194-
195-
:global(.pane.drawer-normal),
196-
:global(.pane:not(.drawer-fullscreen)) {
114+
overflow-y: auto !important;
115+
overflow-x: hidden !important;
116+
-webkit-overflow-scrolling: touch;
197117
width: 95% !important;
198118
max-height: 600px !important;
199119
min-height: 250px !important;
@@ -204,18 +124,6 @@ $effect(() => {
204124
padding-block-end: 20px !important;
205125
}
206126
207-
:global(.pane.drawer-fullscreen) {
208-
width: 100% !important;
209-
max-height: 80vh !important;
210-
min-height: 80vh !important;
211-
height: 80vh !important;
212-
bottom: 0 !important;
213-
top: auto !important;
214-
border-radius: 0 !important;
215-
padding-block-start: 0 !important;
216-
padding-block-end: 0 !important;
217-
}
218-
219127
:global(.move) {
220128
display: none !important;
221129
margin-block: 6px !important;

infrastructure/eid-wallet/src/routes/(app)/scan-qr/+page.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ $effect(() => {
100100
101101
async function handleAuthDrawerDecline() {
102102
// Cancel button always navigates to main dashboard
103-
setCodeScannedDrawerOpen(false);
104-
await goto("/main");
103+
setCodeScannedDrawerOpen(false);
104+
await goto("/main");
105105
}
106106
107107
function handleAuthDrawerOpenChange(value: boolean) {
@@ -121,8 +121,8 @@ function handleLoggedInDrawerOpenChange(value: boolean) {
121121
122122
async function handleSigningDrawerDecline() {
123123
// Cancel button always navigates to main dashboard
124-
setSigningDrawerOpen(false);
125-
await goto("/main");
124+
setSigningDrawerOpen(false);
125+
await goto("/main");
126126
}
127127
128128
function handleSigningDrawerOpenChange(value: boolean) {

infrastructure/eid-wallet/src/routes/(auth)/verify/+page.svelte

Lines changed: 15 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,8 @@ function watchEventStream(id: string) {
170170
SelfiePic.set(null);
171171
}
172172
verifStep.set(3);
173-
// Navigate to verify page and show drawer with results immediately
174-
showVeriffModal = true;
175-
goto("/verify");
173+
// Data is now available in stores for selfie page to use
174+
// Don't navigate - stay on selfie page which will show results
176175
};
177176
}
178177
@@ -254,11 +253,6 @@ onMount(async () => {
254253
globalState = getContext<() => GlobalState>("globalState")();
255254
// handle verification logic + sec user data in the store
256255
257-
// If verification is complete (step 3), show drawer immediately
258-
if ($verifStep === 3) {
259-
showVeriffModal = true;
260-
}
261-
262256
// Provide showVeriffModal context to child components
263257
setContext("showVeriffModal", {
264258
get value() {
@@ -269,6 +263,19 @@ onMount(async () => {
269263
},
270264
});
271265
266+
// Provide verification data context for selfie page
267+
setContext("verifyData", {
268+
get person() {
269+
return person;
270+
},
271+
get document() {
272+
return document;
273+
},
274+
get websocketData() {
275+
return websocketData;
276+
},
277+
});
278+
272279
// Check hardware key support first
273280
await checkHardwareKeySupport();
274281
@@ -411,54 +418,6 @@ onMount(async () => {
411418
<div>
412419
{#if $verifStep === 0}
413420
<DocumentType />
414-
{:else if loading}
415-
<div class="my-20">
416-
<div
417-
class="align-center flex w-full flex-col items-center justify-center gap-6"
418-
>
419-
<Shadow size={40} color="rgb(142, 82, 255);" />
420-
<h3>Generating your eName</h3>
421-
</div>
422-
</div>
423-
{:else}
424-
<div class="flex flex-col gap-6">
425-
{#if $status === "approved"}
426-
<div>
427-
<h3>Your verification was a success</h3>
428-
<p>You can now continue on to create your eName</p>
429-
</div>
430-
{:else if $status === "duplicate"}
431-
<div>
432-
<h3>Old eVault Found</h3>
433-
<p>
434-
We found an existing eVault associated with your
435-
identity. You can claim it back to continue
436-
using your account.
437-
</p>
438-
</div>
439-
{:else if $status === "resubmission_requested"}
440-
<h3>Your verification failed due to the reason</h3>
441-
<p>{$reason}</p>
442-
{:else}
443-
<h3>Your verification failed</h3>
444-
445-
<p>{$reason}</p>
446-
{/if}
447-
</div>
448-
<div class="flex w-full flex-col pt-4">
449-
{#if $status !== "declined"}
450-
<ButtonAction
451-
class="w-[100%]"
452-
callback={handleContinue}
453-
color="primary"
454-
>{$status === "approved"
455-
? "Continue"
456-
: $status === "duplicate"
457-
? "Claim old eVault"
458-
: "Retry"}</ButtonAction
459-
>
460-
{/if}
461-
</div>
462421
{/if}
463422
</div>
464423
</Drawer>

infrastructure/eid-wallet/src/routes/(auth)/verify/steps/document-type.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ function goBack() {
4444
<span>go back</span>
4545
</button>
4646
<div class="flex-1">
47-
<h3>Choose Document Type</h3>
48-
<p>Select the type of identity document you will be presenting</p>
47+
<h3>Choose Document Type</h3>
48+
<p>Select the type of identity document you will be presenting</p>
4949
</div>
5050
</div>
5151

infrastructure/eid-wallet/src/routes/(auth)/verify/steps/passport.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ onMount(() => {
246246
<span>go back</span>
247247
</button>
248248
<div>
249-
<h3>
249+
<h3>
250250
{#if $documentType === "passport"}
251251
Present your Passport
252252
{:else if $documentType === "id"}

0 commit comments

Comments
 (0)