1+ <script lang =" ts" >
2+ import { goto } from " $app/navigation" ;
3+ import { Hero , IdentityCard } from " $lib/fragments" ;
4+ import { Drawer } from " $lib/ui" ;
5+ import * as Button from " $lib/ui/Button" ;
6+ import { QrCodeIcon } from " @hugeicons/core-free-icons" ;
7+ import { HugeiconsIcon } from " @hugeicons/svelte" ;
8+ import type { Snippet } from " svelte" ;
9+
10+ const dummyData = {
11+ Name: " John Doe" ,
12+ " Date of birth" : " 01 - 01 - 1990" ,
13+ " ID submitted" : " American Passport" ,
14+ " Passport number" : " 1234567-US" ,
15+ };
16+
17+ let shareQRdrawerOpen = $state (false );
18+
19+ function shareQR() {
20+ alert (" QR Code shared!" );
21+ shareQRdrawerOpen = false ;
22+ }
23+ </script >
24+
25+
26+ <Hero
27+ title =" Good morning!"
28+ subtitle =" Don't forget to drink water."
29+ showSettings
30+ />
31+
32+ {#snippet Section (title : string , children : Snippet )}
33+ <section class =" mt-8" >
34+ <h4 class ="mb-2" >{title }</h4 >
35+ {@render children ()}
36+ </section >
37+ {/ snippet }
38+
39+ {#snippet eName ()}
40+ <IdentityCard
41+ variant =" eName"
42+ userId =" caa0f630-2413-5aceaa2c-4628ce93e497"
43+ viewBtn ={() => alert (" View button clicked!" )}
44+ shareBtn ={() => shareQRdrawerOpen = true }
45+ />
46+ {/ snippet }
47+ {#snippet ePassport ()}
48+ <IdentityCard
49+ variant =" ePassport"
50+ viewBtn ={() => goto (" /ePassport" )}
51+ userData ={dummyData }
52+ />
53+ {/ snippet }
54+ {#snippet eVault ()}
55+ <IdentityCard
56+ variant =" eVault"
57+ usedStorage ={15 }
58+ totalStorage ={100 }
59+ />
60+ {/ snippet }
61+
62+ {@render Section (" eName" , eName )}
63+ {@render Section (" ePassport" , ePassport )}
64+ {@render Section (" eVault" , eVault )}
65+
66+ <Drawer
67+ title =" Scan QR Code"
68+ bind:isPaneOpen ={shareQRdrawerOpen }
69+ isCancelRequired ={true }
70+ class =" flex flex-col gap-4 items-center justify-center"
71+ >
72+ <div class =" flex justify-center relative items-center overflow-hidden h-full bg-gray rounded-3xl p-8" >
73+ <div class =" bg-white h-[72px] w-[1000px] -rotate-45 absolute top-4" ></div >
74+ <div class =" bg-white h-[72px] w-[1000px] -rotate-45 absolute bottom-4" ></div >
75+ <img class =" z-10" src =" /images/dummyQR.png" alt =" QR Code" />
76+ </div >
77+
78+ <h4 class =" text-center" >Share your eName</h4 >
79+ <p class =" text-black-700 text-center" >Anyone scanning this can see your eName</p >
80+ <div class =" flex justify-center items-center mt-4" >
81+ <Button .Action
82+ variant =" solid"
83+ callback ={shareQR }
84+ class =" w-full"
85+ >
86+ Share
87+ </Button .Action >
88+ </div >
89+ </Drawer >
90+
91+ <Button .Nav href =" /scan-qr" >
92+ <Button .Action
93+ variant =" solid"
94+ onclick ={() => alert (" Action button clicked!" )}
95+ class =" mx-auto text-nowrap flex gap-8 fixed bottom-5 left-1/2 -translate-x-1/2 z-10"
96+ >
97+ <HugeiconsIcon
98+ size ={32 }
99+ strokeWidth ={2 }
100+ className =" mr-2"
101+ icon ={QrCodeIcon }
102+ />
103+ Scan to Login
104+ </Button .Action >
105+ </Button .Nav >
0 commit comments