Skip to content

Commit

Permalink
fix: notifications to history
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebus-84 committed May 3, 2024
1 parent c23c607 commit 59c9f39
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/lib/components/tabs/TabPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
export let tab: Tab;
export let title: string;
export let settings = false
</script>

<ion-tab {tab}>
<Header backButton={false} {settings}>{title}</Header>
<Header backButton={false}>{title}</Header>

<ion-content fullscreen class="ion-padding">
<slot />
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/tabs/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const Tabs = {
home: 'home',
notifications: 'notifications',
history: 'history',
profile: 'profile'
} as const;

Expand Down
2 changes: 1 addition & 1 deletion src/routes/[[lang]]/(protected)/(tabs)/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const tabs: IonTabProps[] = [
{ label: 'Home', icon: home, tab: Tabs.home },
{ label: 'Notifications', icon: notificationsOutline, tab: Tabs.notifications },
{ label: 'History', icon: notificationsOutline, tab: Tabs.history },
{ label: 'Profile', icon: personOutline, tab: Tabs.profile }
];
</script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<script lang="ts">
import { TabPage } from '$lib/components/tabs';
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
dayjs.extend(relativeTime);
export let data;
const { verifiedSids } = data;
</script>

<TabPage tab="notifications" title="Notifications">
<TabPage tab="history" title="History">
<div class="flex flex-col items-center justify-center gap-2">
{#each verifiedSids as verifiedSid}
{#each verifiedSids.reverse() as verifiedSid}
<div class="flex flex-col rounded-md border-on bg-primary p-4 w-full">
<div class="flex flex-col items-start justify-center gap-1">
<d-heading size="s">{verifiedSid.sid}</d-heading>
Expand All @@ -17,7 +19,7 @@
<div
class="h-[5px] w-[5px] shrink-0 rounded-full border border-solid border-warning bg-warning"
/>
<d-text size="s">{dayjs.unix(verifiedSid.at).toString()}</d-text>
<d-text size="s">{dayjs().to(dayjs.unix(verifiedSid.at))}</d-text>
</div>
</div>
</div>
Expand Down

0 comments on commit 59c9f39

Please sign in to comment.