-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: correct typography. Sort data in home. Show credentials. (#101)
- Loading branch information
Showing
13 changed files
with
106 additions
and
455 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,42 @@ | ||
const fakeCredentials = [ | ||
{ | ||
"title": "Over 18", | ||
"issuedBy": "ItGov", | ||
"link": "0" | ||
}, | ||
{ | ||
"title": "Degree in Biology", | ||
"issuedBy": "Venice University", | ||
"link": "1" | ||
}, | ||
{ | ||
"title": "Driving license b", | ||
"issuedBy": "motorization", | ||
"link": "2" | ||
} | ||
] | ||
function getRandomIssuer() { | ||
const issuers = ['Didroom', 'Forkbomb BV', 'Italian Government', 'Random Authority A', 'Random Authority B']; | ||
return issuers[Math.floor(Math.random() * issuers.length)]; | ||
} | ||
|
||
export default fakeCredentials | ||
function getRandomExpirationDate() { | ||
const currentDate = new Date(); | ||
const futureDate = new Date( | ||
currentDate.getFullYear() + Math.floor(Math.random() * 5), | ||
Math.floor(Math.random() * 12), | ||
Math.floor(Math.random() * 28) + 1 | ||
); | ||
|
||
const year = futureDate.getFullYear(); | ||
const month = (futureDate.getMonth() + 1).toString().padStart(2, '0'); | ||
const day = futureDate.getDate().toString().padStart(2, '0'); | ||
|
||
return `${year}-${day}-${month}`; | ||
} | ||
|
||
const credentialsInfo = [ | ||
{ name: 'Over 13', description: 'This credential proves that you are over 13 years old' }, | ||
{ name: 'Over 18', description: 'This credential proves that you are over 18 years old' }, | ||
{ name: 'Age range 18-65', description: 'This credential proves that you are in a specific age range (18-65)' }, | ||
{ name: 'Residency proof', description: 'This credential proves your residency status' }, | ||
{ name: 'Address proof', description: 'This credential serves as proof of your address' }, | ||
{ name: 'Email proof', description: 'This credential proves the validity of your email address' }, | ||
{ name: 'Diploma', description: 'This credential proves that you have earned a diploma' }, | ||
{ name: 'Driving license', description: 'This credential serves as proof of your driving license' }, | ||
{ name: 'Vaccination', description: 'This credential proves that you have been vaccinated' }, | ||
{ name: 'Proof of employment', description: 'This credential proves your employment status' }, | ||
{ name: 'Proof of humanity', description: 'This credential proves that you are alive' } | ||
]; | ||
|
||
const fakeCredentials = credentialsInfo.map((credential) => ({ | ||
...credential, | ||
issuer: getRandomIssuer(), | ||
expirationDate: getRandomExpirationDate(), | ||
verified: Boolean(Math.random() < 0.6) // 80% chance of being verified | ||
})); | ||
|
||
export default fakeCredentials; |
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 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 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 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 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 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,15 +1,24 @@ | ||
<script lang="ts"> | ||
import TabPage from '$lib/tabs/TabPage.svelte'; | ||
import ScanButton from '$lib/components/molecules/ScanButton.svelte'; | ||
import Card from '$lib/components/molecules/Card.svelte'; | ||
import fakeCredentials from '$lib/fakeCredentials'; | ||
</script> | ||
|
||
<TabPage tab="wallet" title="WALLET"> | ||
{#each fakeCredentials as credential} | ||
<Card title={credential.title} content={credential.issuedBy}> | ||
<ion-button href="/scan">Verify</ion-button> | ||
</Card> | ||
{/each} | ||
<d-heading> | ||
<h1>My issued credentials</h1> | ||
</d-heading> | ||
<d-text size="l"> <p class="pb-4">Explore and manage your verified credentials</p></d-text> | ||
<div class="flex flex-col gap-2"> | ||
{#each fakeCredentials as credential} | ||
<d-credential-card | ||
name={credential.name} | ||
issuer={credential.issuer} | ||
description={credential.description} | ||
expiration-date={credential.expirationDate} | ||
verified={credential.verified} | ||
/> | ||
{/each} | ||
</div> | ||
<ScanButton /> | ||
</TabPage> |
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 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,5 +1,5 @@ | ||
import { redirect } from '@sveltejs/kit'; | ||
|
||
export const load = async () => { | ||
throw redirect(301, '/wallet'); | ||
throw redirect(301, '/home'); | ||
}; |
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,12 +1,13 @@ | ||
ion-content::part(background) { | ||
background-color: var(--surface); | ||
} | ||
|
||
ion-text { | ||
color: var(--on-primary); | ||
} | ||
|
||
ion-button::part(native) { | ||
background-color: var(--inverted-primary); | ||
color: var(--inverted-on-primary) | ||
.material-symbols-rounded { | ||
font-family: 'Material Symbols Rounded'; | ||
font-weight: normal; | ||
font-style: normal; | ||
font-size: 24px; /* Preferred icon size */ | ||
display: inline-block; | ||
line-height: 1; | ||
text-transform: none; | ||
letter-spacing: normal; | ||
word-wrap: normal; | ||
white-space: nowrap; | ||
direction: ltr; | ||
} |
Oops, something went wrong.