refactor(ui): ChannelPage Videos/About tabs -> shared Tabs (R13 S2c)
The channel page's underline tab pair was the last hand-rolled tab idiom on a swept surface. It now uses the shared <Tabs> (rounded-lg pill, active accent shadow) like every other tab-set, sitting inline with the channel action buttons on the same separator row. Drops the bespoke tabClass helper. Only the NavSidebar icon rail (aria-current, icon-only app nav) stays a distinct idiom. Self-E2E'd: Videos/About switch, content flips. gate green (tsc/eslint-0/ prettier). Branch not merged.
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
|||||||
SlidersHorizontal,
|
SlidersHorizontal,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import Avatar from "./Avatar";
|
import Avatar from "./Avatar";
|
||||||
|
import Tabs from "./Tabs";
|
||||||
import Feed from "./Feed";
|
import Feed from "./Feed";
|
||||||
import ChannelAboutContent from "./ChannelAbout";
|
import ChannelAboutContent from "./ChannelAbout";
|
||||||
import { PageToolbar, PageToolbarSlot } from "./PageShell";
|
import { PageToolbar, PageToolbarSlot } from "./PageShell";
|
||||||
@@ -265,11 +266,6 @@ export default function ChannelPage({
|
|||||||
: null,
|
: null,
|
||||||
joined ? t("channel.joined", { date: joined }) : null,
|
joined ? t("channel.joined", { date: joined }) : null,
|
||||||
].filter(Boolean) as string[];
|
].filter(Boolean) as string[];
|
||||||
const tabClass = (active: boolean) =>
|
|
||||||
active
|
|
||||||
? "pb-2 text-sm font-medium border-b-2 border-fg text-fg"
|
|
||||||
: "pb-2 text-sm text-muted hover:text-fg border-b-2 border-transparent";
|
|
||||||
|
|
||||||
// The channel page owns no scroller of its own (PageShell provides the one app scroller). Its
|
// The channel page owns no scroller of its own (PageShell provides the one app scroller). Its
|
||||||
// whole chrome is fixed — wrapped in <PageToolbar> it portals into the shell's fixed band, so the
|
// whole chrome is fixed — wrapped in <PageToolbar> it portals into the shell's fixed band, so the
|
||||||
// banner/identity/tabs/toolbar stay put and only the video grid scrolls.
|
// banner/identity/tabs/toolbar stay put and only the video grid scrolls.
|
||||||
@@ -370,14 +366,17 @@ export default function ChannelPage({
|
|||||||
{/* Tabs — the channel actions ride along here rather than off in the header's top-right
|
{/* Tabs — the channel actions ride along here rather than off in the header's top-right
|
||||||
corner: there are only ever two tabs, so there's room, and it keeps the things you click
|
corner: there are only ever two tabs, so there's room, and it keeps the things you click
|
||||||
within a few pixels of each other instead of across the page. */}
|
within a few pixels of each other instead of across the page. */}
|
||||||
<div className="flex items-center gap-4 mt-3 border-b border-border">
|
<div className="flex items-center gap-2 mt-3 border-b border-border pb-2">
|
||||||
<button onClick={() => setTab("videos")} className={tabClass(tab === "videos")}>
|
<Tabs
|
||||||
{t("channel.tabVideos")}
|
className="flex gap-1"
|
||||||
</button>
|
active={tab}
|
||||||
<button onClick={() => setTab("about")} className={tabClass(tab === "about")}>
|
onChange={(id) => setTab(id as "videos" | "about")}
|
||||||
{t("channel.tabAbout")}
|
tabs={[
|
||||||
</button>
|
{ id: "videos", label: t("channel.tabVideos") },
|
||||||
<div className="ml-2 flex items-center gap-2 pb-1.5">
|
{ id: "about", label: t("channel.tabAbout") },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<div className="ml-2 flex items-center gap-2">
|
||||||
<a
|
<a
|
||||||
href={ytUrl}
|
href={ytUrl}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|||||||
Reference in New Issue
Block a user