-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes: #119 closes: #118 closes: #120 - feat: ask for credendial flow - 💄: add lottie animation to waiting --------- Co-authored-by: Puria Nafisi Azizi <[email protected]>
- Loading branch information
1 parent
8cfc9b9
commit fb83951
Showing
8 changed files
with
115 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/routes/(protected)/request/[id]/+page.ts → src/routes/(protected)/[id]/+layout.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { getService } from '$lib/slangroom/services.js'; | ||
|
||
export const load = async ({ params }) => { | ||
const credential = getService(params.id) | ||
return {credential}; | ||
}; | ||
const credential = await getService(params.id); | ||
return { credential }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<script lang="ts"> | ||
import Logo from '$lib/components/atoms/Logo.svelte'; | ||
import JSONSchemaForm from '$lib/JSONSchemaForms/JSONSchemaForm.svelte'; | ||
import JSONSchemaParser from '$lib/JSONSchemaForms/JSONSchemaParser.svelte'; | ||
import ErrorDisplay from '$lib/components/errorDisplay.svelte'; | ||
import { fly } from 'svelte/transition'; | ||
import { thumbsUpOutline } from 'ionicons/icons'; | ||
import { goto } from '$app/navigation'; | ||
import { LottiePlayer } from '@lottiefiles/svelte-lottie-player'; | ||
export let data: any; | ||
const { credential } = data; | ||
let isModalOpen: boolean = false; | ||
let isCredentialVerified: boolean = false; | ||
const getCredential = () => { | ||
isModalOpen = true; | ||
setTimeout(() => { | ||
isCredentialVerified = true; | ||
setTimeout(() => { | ||
isModalOpen = false; | ||
goto('/home'); | ||
}, 3000); | ||
}, 5000); | ||
}; | ||
</script> | ||
|
||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title> | ||
<div class="flex items-center gap-2"> | ||
<Logo /> | ||
<h1 class="text-2xl">Credential offer</h1> | ||
</div> | ||
</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
|
||
<ion-content fullscreen class="ion-padding"> | ||
<div class="flex h-full flex-col justify-between pb-16"> | ||
<div> | ||
<div class="text-on flex items-center gap-2 text-xl font-semibold not-italic"> | ||
<d-avatar name={credential.name}></d-avatar> | ||
<d-heading size="s">{credential.name}</d-heading> | ||
</div> | ||
<div class="mt-2 flex flex-col gap-2"> | ||
<d-text size="l">{credential.expand.templates[0].name}</d-text> | ||
<div class="flex flex-col gap-4"> | ||
<d-text size="s" | ||
>Lorem ipsum dolor sit amet consectetur. Leo ultricies pellentesque morbi in eu metus commodo felis. | ||
Pellentesque facilisis a auctor enim lectus. Nulla dolor cras viverra massa.</d-text | ||
> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<JSONSchemaParser schema={credential.expand.templates[0].schema} let:schema> | ||
<JSONSchemaForm {schema} onSubmit={() => {}} /> | ||
<svelte:fragment slot="error" let:error> | ||
<ErrorDisplay name={error.name} message={error.message} /> | ||
</svelte:fragment> | ||
</JSONSchemaParser> | ||
<pre>{credential.expand.templates[0].schema}</pre> | ||
<div class="w-full"> | ||
<ion-button expand="block" on:click={getCredential} on:keydown={getCredential} aria-hidden | ||
>Get this credential</ion-button | ||
> | ||
<ion-button expand="block" href="/home">decline</ion-button> | ||
</div> | ||
</div> | ||
<ion-modal is-open={isModalOpen} backdrop-dismiss={false} transition:fly class="visible"> | ||
<ion-content class="ion-padding"> | ||
<div class="flex h-full flex-col justify-around"> | ||
<div> | ||
{#if !isCredentialVerified} | ||
We are generating this credential | ||
<d-credential-card name={credential.name} issuer={credential.issuer} description={credential.description} /> | ||
<LottiePlayer | ||
src="https://assets2.lottiefiles.com/packages/lf20_wxUJzo.json" | ||
autoplay={true} | ||
loop={true} | ||
renderer="svg" | ||
background="transparent" | ||
/> | ||
{:else} | ||
<div class="flex w-full justify-around"> | ||
<ion-icon icon={thumbsUpOutline} class="mx-auto my-6 text-9xl text-green-400"></ion-icon> | ||
</div> | ||
{/if} | ||
</div> | ||
</div> | ||
</ion-content> | ||
</ion-modal> | ||
</ion-content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters