1
1
<script lang =" ts" >
2
2
import { Hero , IdentityCard } from " $lib/fragments" ;
3
+ import { Drawer } from " $lib/ui" ;
3
4
import * as Button from " $lib/ui/Button" ;
4
5
import { QrCodeIcon } from " @hugeicons/core-free-icons" ;
5
6
import { HugeiconsIcon } from " @hugeicons/svelte" ;
6
7
import type { Snippet } from " svelte" ;
7
8
8
9
const dummyData = {
9
10
Name: " John Doe" ,
10
- " Date of birth" : " 01/01/ 1990" ,
11
+ " Date of birth" : " 01 - 01 - 1990" ,
11
12
" ID submitted" : " American Passport" ,
12
- " Passport number" : " 123456789 " ,
13
+ " Passport number" : " 1234567-US " ,
13
14
};
15
+
16
+ let shareQRdrawerOpen = $state (false );
17
+
18
+ function shareQR() {
19
+ alert (" QR Code shared!" );
20
+ shareQRdrawerOpen = false ;
21
+ }
14
22
</script >
15
23
16
24
@@ -30,9 +38,9 @@ const dummyData = {
30
38
{#snippet eName ()}
31
39
<IdentityCard
32
40
variant =" eName"
33
- userId =" 1234567890 "
41
+ userId =" caa0f630-2413-5aceaa2c-4628ce93e497 "
34
42
viewBtn ={() => alert (" View button clicked!" )}
35
- shareBtn ={() => alert ( " Share button clicked! " ) }
43
+ shareBtn ={() => shareQRdrawerOpen = true }
36
44
/>
37
45
{/ snippet }
38
46
{#snippet ePassport ()}
@@ -54,6 +62,31 @@ const dummyData = {
54
62
{@render Section (" ePassport" , ePassport )}
55
63
{@render Section (" eVault" , eVault )}
56
64
65
+ <Drawer
66
+ title =" Scan QR Code"
67
+ bind:isPaneOpen ={shareQRdrawerOpen }
68
+ isCancelRequired ={true }
69
+ class =" flex flex-col gap-4 items-center justify-center"
70
+ >
71
+ <div class =" flex justify-center relative items-center overflow-hidden h-full bg-gray rounded-3xl p-8" >
72
+ <div class =" bg-white h-[72px] w-[1000px] -rotate-45 absolute top-4" ></div >
73
+ <div class =" bg-white h-[72px] w-[1000px] -rotate-45 absolute bottom-4" ></div >
74
+ <img class =" z-10" src =" /images/dummyQR.png" alt =" QR Code" />
75
+ </div >
76
+
77
+ <h4 class =" text-center" >Share your eName</h4 >
78
+ <p class =" text-black-700 text-center" >Anyone scanning this can see your eName</p >
79
+ <div class =" flex justify-center items-center mt-4" >
80
+ <Button .Action
81
+ variant =" solid"
82
+ callback ={shareQR }
83
+ class =" w-full"
84
+ >
85
+ Share
86
+ </Button .Action >
87
+ </div >
88
+ </Drawer >
89
+
57
90
<Button .Action
58
91
variant =" solid"
59
92
onclick ={() => alert (" Action button clicked!" )}
0 commit comments