diff --git a/infrastructure/eid-wallet/src/lib/fragments/Header/Header.svelte b/infrastructure/eid-wallet/src/lib/fragments/Header/Header.svelte index e027cdda..cb01ac9e 100644 --- a/infrastructure/eid-wallet/src/lib/fragments/Header/Header.svelte +++ b/infrastructure/eid-wallet/src/lib/fragments/Header/Header.svelte @@ -23,24 +23,20 @@ const cBase = "w-full h-[9vh] flex justify-between items-center";
{#if isBackRequired} - - - window.history.back()}> - - + {:else} - -
\ No newline at end of file diff --git a/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.stories.ts b/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.stories.ts new file mode 100644 index 00000000..e7c221bb --- /dev/null +++ b/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.stories.ts @@ -0,0 +1,53 @@ +import IdentityCard from "./IdentityCard.svelte"; + +interface userData { + [fieldName: string]: string; +} + +export default { + title: "UI/IdentityCard", + component: IdentityCard, + tags: ["autodocs"], + render: (args: { + variant: string; + userId: string; + shareBtn: () => void; + viewBtn: () => void; + userData: userData; + usedStorage: number; + totalStorage: number; + }) => ({ + Component: IdentityCard, + props: args, + }), +}; + +export const eName = { + args: { + variant: "eName", + userId: "ananyayayayaya", + shareBtn: () => alert("Share"), + viewBtn: () => alert("View"), + }, +}; + +export const ePassport = { + args: { + variant: "ePassport", + viewBtn: () => alert("View"), + userData: { + Name: "Ananya", + Dob: "29 Nov 2003", + Nationality: "Indian", + Passport: "234dfvgsdfg", + }, + }, +}; + +export const eVault = { + args: { + variant: "eVault", + usedStorage: "15", + totalStorage: "80", + }, +}; diff --git a/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.svelte b/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.svelte new file mode 100644 index 00000000..caac7458 --- /dev/null +++ b/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.svelte @@ -0,0 +1,101 @@ + + +
+
+
+
+
+
+
+ {#if variant === 'eName'} + +
+ + +
+ {:else if variant === 'ePassport'} +

HIGH SECURITY

+ + {:else if variant === 'eVault'} +
{state.progressWidth} Used
+ {/if} +
+
+ {#if variant === "eName"} +

Your eName

+
+

@{userId}

+
+ {:else if variant === "ePassport"} +
+ {#if userData} + {#each Object.entries(userData) as [fieldName, value] } +
+
{fieldName}
+
{value}
+
+ {/each} + {/if} +
+ {:else if variant === "eVault"} +
+
+
{usedStorage}GB Used
+
{totalStorage}GB Used
+
+
+
+
+
+ {/if} +
+
+
+ + diff --git a/infrastructure/eid-wallet/src/lib/fragments/index.ts b/infrastructure/eid-wallet/src/lib/fragments/index.ts index 77eb7bdd..21e9aaf3 100644 --- a/infrastructure/eid-wallet/src/lib/fragments/index.ts +++ b/infrastructure/eid-wallet/src/lib/fragments/index.ts @@ -1,2 +1,3 @@ export { default as Header } from "./Header/Header.svelte"; +export { default as IdentityCard } from "./IdentityCard/IdentityCard.svelte"; export { default as SettingsNavigationBtn } from "./SettingsNavigationBtn/SettingsNavigationBtn.svelte";