From 85a21f2bd3f36e611dc4b3b80b18978b77ac576c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Fri, 6 Mar 2026 16:19:45 +0100 Subject: [PATCH] nicolium: use react-helmet in less places MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- .../src/features/status/components/thread.tsx | 5 +- packages/nicolium/src/init/nicolium-head.tsx | 2 +- .../nicolium/src/layouts/event-layout.tsx | 83 +++++++++---------- .../nicolium/src/layouts/profile-layout.tsx | 7 +- 4 files changed, 45 insertions(+), 52 deletions(-) diff --git a/packages/nicolium/src/features/status/components/thread.tsx b/packages/nicolium/src/features/status/components/thread.tsx index f54731846..defedd0fe 100644 --- a/packages/nicolium/src/features/status/components/thread.tsx +++ b/packages/nicolium/src/features/status/components/thread.tsx @@ -1,7 +1,6 @@ import { useNavigate } from '@tanstack/react-router'; import clsx from 'clsx'; import React, { useCallback, useEffect, useMemo, useRef } from 'react'; -import { Helmet } from 'react-helmet-async'; import { useIntl } from 'react-intl'; import ScrollableList from '@/components/scrollable-list'; @@ -346,7 +345,7 @@ const Thread = ({ const firstAttachment = status.media_attachments && status.media_attachments[0]; return ( - + <> {status.spoiler_text && } {(firstAttachment?.type === 'image' || firstAttachment?.type === 'gifv') && ( <> @@ -377,7 +376,7 @@ const Thread = ({ {status.edited_at && } {status.account.local === false && } - + ); }, [status]); diff --git a/packages/nicolium/src/init/nicolium-head.tsx b/packages/nicolium/src/init/nicolium-head.tsx index ee91afb23..3121f6774 100644 --- a/packages/nicolium/src/init/nicolium-head.tsx +++ b/packages/nicolium/src/init/nicolium-head.tsx @@ -90,8 +90,8 @@ const NicoliumHead = () => { })} /> - + {`:root { ${themeCss} }`} {['dark', 'black'].includes(theme) && ( {':root { color-scheme: dark; }'} diff --git a/packages/nicolium/src/layouts/event-layout.tsx b/packages/nicolium/src/layouts/event-layout.tsx index e0c7ad742..967804233 100644 --- a/packages/nicolium/src/layouts/event-layout.tsx +++ b/packages/nicolium/src/layouts/event-layout.tsx @@ -1,6 +1,5 @@ import { Outlet, useLocation, useNavigate } from '@tanstack/react-router'; import React, { useMemo } from 'react'; -import { Helmet } from 'react-helmet-async'; import { FormattedMessage } from 'react-intl'; import Column from '@/components/ui/column'; @@ -32,6 +31,47 @@ const EventLayout = () => { const event = status?.event; + const meta = useMemo(() => { + if (!status) return null; + + const firstAttachment = status.media_attachments && status.media_attachments[0]; + + return ( + <> + {status.spoiler_text && } + {(firstAttachment?.type === 'image' || firstAttachment?.type === 'gifv') && ( + <> + + + {firstAttachment.mime_type && ( + + )} + {firstAttachment.meta.original && ( + + )} + {firstAttachment.meta.original && ( + + )} + + )} + + + + + + {status.edited_at && } + + {status.account.local === false && } + + ); + }, [status]); + if (status && !event) { navigate({ to: '/@{$username}/posts/$statusId', @@ -64,47 +104,6 @@ const EventLayout = () => { pathname.endsWith(path), ); - const meta = useMemo(() => { - if (!status) return null; - - const firstAttachment = status.media_attachments && status.media_attachments[0]; - - return ( - - {status.spoiler_text && } - {(firstAttachment?.type === 'image' || firstAttachment?.type === 'gifv') && ( - <> - - - {firstAttachment.mime_type && ( - - )} - {firstAttachment.meta.original && ( - - )} - {firstAttachment.meta.original && ( - - )} - - )} - - - - - - {status.edited_at && } - - {status.account.local === false && } - - ); - }, [status]); - return ( <> {meta} diff --git a/packages/nicolium/src/layouts/profile-layout.tsx b/packages/nicolium/src/layouts/profile-layout.tsx index d4ec6970d..394bcb5fd 100644 --- a/packages/nicolium/src/layouts/profile-layout.tsx +++ b/packages/nicolium/src/layouts/profile-layout.tsx @@ -1,6 +1,5 @@ import { Navigate, Outlet, useLocation } from '@tanstack/react-router'; import React from 'react'; -import { Helmet } from 'react-helmet-async'; import { FormattedMessage } from 'react-intl'; import Column from '@/components/ui/column'; @@ -95,11 +94,7 @@ const ProfileLayout: React.FC = () => { return ( <> - {account?.local === false && ( - - - - )} + {account?.local === false && }