From 50a77745885015aa76f04d7a996c6dd722ec742e Mon Sep 17 00:00:00 2001 From: npeter83 Date: Tue, 30 Jun 2026 04:43:37 +0200 Subject: [PATCH] =?UTF-8?q?polish(channel):=20compact=20header=20=E2=80=94?= =?UTF-8?q?=20stats=20inline,=20slimmer=20banner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move the channel stats (subscribers / videos / views / joined) onto one meta line beside the handle under the name, dropping the separate stats row. - Cap the banner at 150px tall so it no longer dominates the page; the wide YouTube-style crop is kept. Net: the video grid starts much higher. --- frontend/src/components/ChannelPage.tsx | 37 ++++++++++++++----------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/frontend/src/components/ChannelPage.tsx b/frontend/src/components/ChannelPage.tsx index 122772b..1572aa7 100644 --- a/frontend/src/components/ChannelPage.tsx +++ b/frontend/src/components/ChannelPage.tsx @@ -123,6 +123,14 @@ export default function ChannelPage({ const joined = ch?.published_at ? new Date(ch.published_at).toLocaleDateString(i18n.language, { year: "numeric", month: "short" }) : null; + // Handle + stats on one compact meta line under the name (saves the separate stats row). + const metaParts = [ + ch?.handle ? `@${ch.handle.replace(/^@/, "")}` : null, + ch?.subscriber_count != null ? t("channel.subscribers", { formatted: formatViews(ch.subscriber_count) }) : null, + ch?.video_count != null ? t("channel.videoCount", { count: ch.video_count }) : null, + ch?.total_view_count != null ? t("channel.totalViews", { formatted: formatViews(ch.total_view_count) }) : null, + joined ? t("channel.joined", { date: joined }) : null, + ].filter(Boolean) as string[]; const tabClass = (active: boolean) => active ? "pb-2 text-sm font-medium border-b-2 border-fg text-fg" @@ -136,7 +144,10 @@ export default function ChannelPage({ // Match YouTube's banner: the stored bannerExternalUrl is the full 16:9 template at a // low default size, so request a crisp wide version (=w1707) and object-cover the // desktop "safe area" — the centre 2560×423 (~6:1) band — at full width. -
+
)}
- {ch?.handle && ( -
@{ch.handle.replace(/^@/, "")}
- )} +
+ {metaParts.map((part, i) => ( + + {i > 0 && ·} + {part} + + ))} +
- {/* Stats */} -
- {ch?.subscriber_count != null && ( - {t("channel.subscribers", { formatted: formatViews(ch.subscriber_count) })} - )} - {ch?.video_count != null && · {t("channel.videoCount", { count: ch.video_count })}} - {ch?.total_view_count != null && ( - · {t("channel.totalViews", { formatted: formatViews(ch.total_view_count) })} - )} - {joined && · {t("channel.joined", { date: joined })}} -
{exploring && (
@@ -231,7 +236,7 @@ export default function ChannelPage({ )} {/* Tabs */} -
+