From 3b827a90ac4ad79d7692ba84d9a936998188a9a7 Mon Sep 17 00:00:00 2001 From: echo Date: Mon, 23 Feb 2026 05:54:35 +0100 Subject: [PATCH] prod update --- frontend/src/components/ArticleTicker.tsx | 6 ++- frontend/src/components/home/HeroArticle.tsx | 2 +- .../components/home/LatestArticlesGrid.tsx | 11 ++--- .../components/routes/ArchiveComponent.tsx | 23 ++++++----- .../routes/ArticleDetailComponent.tsx | 34 +++++++-------- .../src/components/routes/CategoryPage.tsx | 41 ++++++++++--------- pwa/src/components/ArticleTicker.tsx | 6 ++- pwa/src/components/home/HeroArticle.tsx | 2 +- .../components/home/LatestArticlesGrid.tsx | 11 ++--- .../components/routes/ArchiveComponent.tsx | 23 ++++++----- .../routes/ArticleDetailComponent.tsx | 34 +++++++-------- pwa/src/components/routes/CategoryPage.tsx | 41 ++++++++++--------- pwa/src/hooks/usePushNotifications.ts | 11 ++--- 13 files changed, 128 insertions(+), 117 deletions(-) diff --git a/frontend/src/components/ArticleTicker.tsx b/frontend/src/components/ArticleTicker.tsx index 17de9eb..a2f3a0c 100644 --- a/frontend/src/components/ArticleTicker.tsx +++ b/frontend/src/components/ArticleTicker.tsx @@ -25,7 +25,8 @@ export function ArticleTicker() { {articles.map((article, index) => ( {article.title || 'No title'} @@ -34,7 +35,8 @@ export function ArticleTicker() { {articles.map((article, index) => ( {article.title || 'No title'} diff --git a/frontend/src/components/home/HeroArticle.tsx b/frontend/src/components/home/HeroArticle.tsx index 8d3aa4e..5c32d21 100644 --- a/frontend/src/components/home/HeroArticle.tsx +++ b/frontend/src/components/home/HeroArticle.tsx @@ -122,7 +122,7 @@ export function HeroArticle() { )}
- +
@@ -121,7 +122,7 @@ export function LatestArticlesGrid() { articleId={article.id} title={article.title} url={`${window.location.origin}/articles/${article.id}`} - excerpt={article.excerpt} + excerpt={article.excerpt ?? undefined} image={article.featuredImage} tags={article.tags} variant="compact" diff --git a/frontend/src/components/routes/ArchiveComponent.tsx b/frontend/src/components/routes/ArchiveComponent.tsx index be98b33..d40fc40 100644 --- a/frontend/src/components/routes/ArchiveComponent.tsx +++ b/frontend/src/components/routes/ArchiveComponent.tsx @@ -39,9 +39,10 @@ export function ArchiveComponent() { className="p-6 rounded-xl border bg-card hover:shadow-lg transition-shadow" > + to="/articles/$id" + params={{ id: article.id }} + className="block mb-4" + >

{article.title}

@@ -66,14 +67,14 @@ export function ArchiveComponent() { + articleId={article.id} + title={article.title} + url={`${window.location.origin}/articles/${article.id}`} + excerpt={article.excerpt ?? undefined} + image={article.featuredImage} + tags={article.tags} + variant="compact" + /> ))} diff --git a/frontend/src/components/routes/ArticleDetailComponent.tsx b/frontend/src/components/routes/ArticleDetailComponent.tsx index ad1b43c..1c878f0 100644 --- a/frontend/src/components/routes/ArticleDetailComponent.tsx +++ b/frontend/src/components/routes/ArticleDetailComponent.tsx @@ -42,7 +42,7 @@ export function ArticleDetailComponent({ id }: { id: string }) { return (
@@ -74,14 +74,14 @@ export function ArticleDetailComponent({ id }: { id: string }) { {/* Social Sharing */}
- + Share this article:

@@ -135,8 +135,9 @@ export function CategoryPage({ categorySlug, categoryName, categoryDescription } className="p-6 rounded-xl border bg-card hover:shadow-lg transition-shadow group" >

{article.title} @@ -162,14 +163,14 @@ export function CategoryPage({ categorySlug, categoryName, categoryDescription }

+ articleId={article.id} + title={article.title} + url={`${window.location.origin}/articles/${article.id}`} + excerpt={article.excerpt ?? undefined} + image={article.featuredImage} + tags={article.tags} + variant="compact" + /> ))} diff --git a/pwa/src/components/ArticleTicker.tsx b/pwa/src/components/ArticleTicker.tsx index 17de9eb..a2f3a0c 100644 --- a/pwa/src/components/ArticleTicker.tsx +++ b/pwa/src/components/ArticleTicker.tsx @@ -25,7 +25,8 @@ export function ArticleTicker() { {articles.map((article, index) => ( {article.title || 'No title'} @@ -34,7 +35,8 @@ export function ArticleTicker() { {articles.map((article, index) => ( {article.title || 'No title'} diff --git a/pwa/src/components/home/HeroArticle.tsx b/pwa/src/components/home/HeroArticle.tsx index 8d3aa4e..5c32d21 100644 --- a/pwa/src/components/home/HeroArticle.tsx +++ b/pwa/src/components/home/HeroArticle.tsx @@ -122,7 +122,7 @@ export function HeroArticle() { )}
- +
@@ -121,7 +122,7 @@ export function LatestArticlesGrid() { articleId={article.id} title={article.title} url={`${window.location.origin}/articles/${article.id}`} - excerpt={article.excerpt} + excerpt={article.excerpt ?? undefined} image={article.featuredImage} tags={article.tags} variant="compact" diff --git a/pwa/src/components/routes/ArchiveComponent.tsx b/pwa/src/components/routes/ArchiveComponent.tsx index be98b33..d40fc40 100644 --- a/pwa/src/components/routes/ArchiveComponent.tsx +++ b/pwa/src/components/routes/ArchiveComponent.tsx @@ -39,9 +39,10 @@ export function ArchiveComponent() { className="p-6 rounded-xl border bg-card hover:shadow-lg transition-shadow" > + to="/articles/$id" + params={{ id: article.id }} + className="block mb-4" + >

{article.title}

@@ -66,14 +67,14 @@ export function ArchiveComponent() { + articleId={article.id} + title={article.title} + url={`${window.location.origin}/articles/${article.id}`} + excerpt={article.excerpt ?? undefined} + image={article.featuredImage} + tags={article.tags} + variant="compact" + /> ))} diff --git a/pwa/src/components/routes/ArticleDetailComponent.tsx b/pwa/src/components/routes/ArticleDetailComponent.tsx index ad1b43c..1c878f0 100644 --- a/pwa/src/components/routes/ArticleDetailComponent.tsx +++ b/pwa/src/components/routes/ArticleDetailComponent.tsx @@ -42,7 +42,7 @@ export function ArticleDetailComponent({ id }: { id: string }) { return (
@@ -74,14 +74,14 @@ export function ArticleDetailComponent({ id }: { id: string }) { {/* Social Sharing */}
- + Share this article:

@@ -135,8 +135,9 @@ export function CategoryPage({ categorySlug, categoryName, categoryDescription } className="p-6 rounded-xl border bg-card hover:shadow-lg transition-shadow group" >

{article.title} @@ -162,14 +163,14 @@ export function CategoryPage({ categorySlug, categoryName, categoryDescription }

+ articleId={article.id} + title={article.title} + url={`${window.location.origin}/articles/${article.id}`} + excerpt={article.excerpt ?? undefined} + image={article.featuredImage} + tags={article.tags} + variant="compact" + /> ))} diff --git a/pwa/src/hooks/usePushNotifications.ts b/pwa/src/hooks/usePushNotifications.ts index 0a6c4b7..4270184 100644 --- a/pwa/src/hooks/usePushNotifications.ts +++ b/pwa/src/hooks/usePushNotifications.ts @@ -18,8 +18,8 @@ function checkPushSupport(): boolean { ); } -function getInitialPermission(): NotificationPermission | 'not-supported' { - if (!checkPushSupport()) return 'not-supported'; +function getInitialPermission(): NotificationPermission { + if (!checkPushSupport()) return 'denied'; return Notification.permission; } @@ -27,7 +27,7 @@ export interface UsePushNotificationsReturn { isSupported: boolean; isSubscribed: boolean; isLoading: boolean; - permissionState: NotificationPermission | 'not-supported'; + permissionState: NotificationPermission; subscribe: () => Promise; unsubscribe: () => Promise; requestPermission: () => Promise; @@ -54,7 +54,7 @@ export function usePushNotifications(): UsePushNotificationsReturn { const requestPermission = useCallback(async (): Promise => { - if (!isSupported) return 'not-supported'; + if (!isSupported) return 'denied'; const permission = await Notification.requestPermission(); setPermissionState(permission); @@ -96,9 +96,10 @@ export function usePushNotifications(): UsePushNotificationsReturn { let subscription = await registration.pushManager.getSubscription(); if (!subscription) { + const keyArray = urlBase64ToUint8Array(publicKey); subscription = await registration.pushManager.subscribe({ userVisibleOnly: true, - applicationServerKey: urlBase64ToUint8Array(publicKey), + applicationServerKey: keyArray.buffer as ArrayBuffer, }); }