-
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.
chores: use more didroom-components (#64)
* chores: update header component * fix: add settings to profile page * chores: update profile/organizations components * fix: add requestKey to verification flows query to avoid errors * chores: update activity page with didroom-components
- Loading branch information
1 parent
67603e9
commit 458e7c1
Showing
10 changed files
with
70 additions
and
100 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
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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { goto } from "$lib/i18n"; | ||
|
||
export const back = () => goto('/'); |
46 changes: 29 additions & 17 deletions
46
src/routes/[[lang]]/(protected)/(tabs)/activity/+page.svelte
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,35 +1,47 @@ | ||
<script lang="ts"> | ||
import dayjs from 'dayjs'; | ||
import relativeTime from 'dayjs/plugin/relativeTime'; | ||
import EmptyState from '$lib/components/molecules/EmptyState.svelte'; | ||
import Bell from '$lib/assets/bell.svelte'; | ||
import { m } from '$lib/i18n'; | ||
import { arrowForwardOutline } from 'ionicons/icons'; | ||
dayjs.extend(relativeTime); | ||
export let data; | ||
const { verifiedSids } = data; | ||
const openSettings = async () => { | ||
await NativeSettings.open({ | ||
optionAndroid: AndroidSettings.AppNotification, | ||
optionIOS: IOSSettings.App | ||
}); | ||
}; | ||
</script> | ||
|
||
<d-tab-page tab="activity" title="Activity"> | ||
<div class="flex flex-col items-center justify-center gap-2"> | ||
{#if verifiedSids && verifiedSids.length > 0} | ||
{#each verifiedSids.reverse() as verifiedSid} | ||
<div class="flex w-full flex-col rounded-md border-on bg-primary p-4"> | ||
<div class="flex flex-col items-start justify-center gap-1"> | ||
<d-heading size="s">{verifiedSid.sid}</d-heading> | ||
<d-text size="m">{verifiedSid.success ? 'verified' : 'failure'}</d-text> | ||
<div class="flex items-center gap-2.5"> | ||
<div | ||
class="h-[5px] w-[5px] shrink-0 rounded-full border border-solid border-warning bg-warning" | ||
/> | ||
<d-text size="s">{dayjs().to(dayjs.unix(verifiedSid.at))}</d-text> | ||
</div> | ||
</div> | ||
</div> | ||
<d-activity-card | ||
name={verifiedSid.sid} | ||
description={verifiedSid.success ? 'verified' : 'failure'} | ||
date={dayjs().to(dayjs.unix(verifiedSid.at))} | ||
/> | ||
{/each} | ||
{:else} | ||
<EmptyState | ||
title="No activity yet" | ||
subtitle="Get alerts on new activities and keep your account up-to-date." | ||
/> | ||
<d-empty-state | ||
heading={m.No_activity_yet()} | ||
text={m.Get_alerts_on_new_activities_and_keep_your_account_uptodate_()} | ||
> | ||
<Bell /> | ||
<d-button | ||
expand | ||
color="outline" | ||
on:click={openSettings} | ||
on:keydown={openSettings} | ||
aria-hidden | ||
> | ||
{m.NOTIFICATIONS_SETTINGS()} <ion-icon slot="end" icon={arrowForwardOutline} /> | ||
</d-button> | ||
</d-empty-state> | ||
{/if} | ||
</div> | ||
</d-tab-page> |
31 changes: 16 additions & 15 deletions
31
src/routes/[[lang]]/(protected)/(tabs)/profile/+page.svelte
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,25 +1,26 @@ | ||
<script lang="ts"> | ||
import { authFilesUri, filesUri } from '$lib/backendUri.js'; | ||
import AppDetails from '$lib/components/AppDetails.svelte'; | ||
import Settings from '$lib/components/molecules/Settings.svelte'; | ||
import { m } from '$lib/i18n'; | ||
export let data; | ||
const { orgs, user } = data; | ||
</script> | ||
|
||
<d-tab-page tab="profile" title="Profile"> | ||
<div class="flex flex-col items-center gap-2 pt-8 text-center"> | ||
<d-avatar src={authFilesUri(user?.avatar, user?.id)} size="xl"></d-avatar> | ||
<d-heading size="s" class="w-full">{user?.name || user?.email}</d-heading> | ||
{#if orgs.length > 0} | ||
<d-heading size="xs" class="mt-16 w-full text-center">{'Badges'}</d-heading> | ||
<div class="mx-auto mt-8 flex w-11/12 flex-wrap items-center justify-between gap-2"> | ||
{#each orgs as org} | ||
<d-avatar src={filesUri(org.avatar, org.collectionId, org.id)} alt={org.name} size="xl" /> | ||
{/each} | ||
</div> | ||
{/if} | ||
<d-button href="/logout" class="mt-20 w-full" color="outline" expand>Logout</d-button> | ||
<AppDetails /> | ||
<d-tab-page tab="profile" title="Profile" settings> | ||
<div class="flex h-full flex-col justify-between gap-24"> | ||
<div class="flex flex-col items-center gap-2 pt-8 text-center"> | ||
<d-avatar src={authFilesUri(user?.avatar, user?.id)} size="xl"></d-avatar> | ||
<d-heading size="xs" class="w-full">{user?.name || user?.email}</d-heading> | ||
</div> | ||
<d-organizations heading={m.Badges()} empty={orgs.length == 0}> | ||
{#each orgs as org} | ||
<d-avatar src={filesUri(org.avatar, org.collectionId, org.id)} alt={org.name} size="xl" /> | ||
{/each} | ||
</d-organizations> | ||
</div> | ||
<div slot="settings"> | ||
<Settings /> | ||
</div> | ||
</d-tab-page> |
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