diff --git a/src/lib/a/index.ts b/src/lib/a/index.ts index 71b7fbc..455b2a5 100644 --- a/src/lib/a/index.ts +++ b/src/lib/a/index.ts @@ -7,6 +7,7 @@ export { default as ANostrBadge } from './primitives/ANostrBadge.svelte'; export { default as ANostrBadgeRow } from './primitives/ANostrBadgeRow.svelte'; export { default as AThemeToggleMini } from './primitives/AThemeToggleMini.svelte'; export { default as AAlert } from './primitives/AAlert.svelte'; +export { default as APagination } from './primitives/APagination.svelte'; export { default as AReaderPage } from './reader/AReaderPage.svelte'; export { default as AReaderToolbar } from './reader/AReaderToolbar.svelte'; diff --git a/src/lib/a/primitives/APagination.svelte b/src/lib/a/primitives/APagination.svelte new file mode 100644 index 0000000..2672e90 --- /dev/null +++ b/src/lib/a/primitives/APagination.svelte @@ -0,0 +1,63 @@ + + +{#if totalPages > 1} +
+
+ Page {currentPage} of {totalPages} ({totalItems} total {itemsLabel}) +
+
+ + + {currentPage} / {totalPages} + + +
+
+{/if} diff --git a/src/lib/components/Notifications.svelte b/src/lib/components/Notifications.svelte index 45f9c1b..98f72b8 100644 --- a/src/lib/components/Notifications.svelte +++ b/src/lib/components/Notifications.svelte @@ -1,6 +1,6 @@ {#if isOwnProfile && $userStore.signedIn} -
+
Notifications @@ -883,28 +883,21 @@
{:else if error} -
+

Error loading {notificationMode === "public-messages" ? "public messages" : "notifications"}: {error}

-
+ {:else if notificationMode === "public-messages"} {#if publicMessages.length === 0} -
-

No public messages found.

-
+

No public messages found.

{:else} -
+
{#if filteredByUser}
-
- - Filtered by user: @{authorProfiles.get(filteredByUser)?.displayName || authorProfiles.get(filteredByUser)?.name || "anon"} - - +
{/if} @@ -913,21 +906,14 @@ {@const authorProfile = authorProfiles.get(message.pubkey)} {@const isFromUser = message.pubkey === $userStore.pubkey}
-
+
-
+
{#if authorProfile?.picture} - Author avatar + {:else} -
- -
+ {/if}
@@ -938,7 +924,7 @@ {#if !isFromUser} -
+
+ + {message.created_at ? formatDate(message.created_at) : "Unknown date"} +
@@ -1039,30 +1025,14 @@ {#if totalPages > 1} -
-
- Page {currentPage} of {totalPages} ({allPublicMessages.length} total messages) -
-
- - - {currentPage} / {totalPages} - - -
-
+ {/if}
{/if} @@ -1165,30 +1135,14 @@ {#if totalPages > 1} -
-
- Page {currentPage} of {totalPages} ({notificationMode === "to-me" ? allToMeNotifications.length : allFromMeNotifications.length} total notifications) -
-
- - - {currentPage} / {totalPages} - - -
-
+ {/if}
{/if} diff --git a/src/routes/profile/+page.svelte b/src/routes/profile/+page.svelte index 5ce7af1..ab889af 100644 --- a/src/routes/profile/+page.svelte +++ b/src/routes/profile/+page.svelte @@ -1,5 +1,5 @@