refactor(channels): share one ChannelLink + channelYouTubeUrl helper

The "avatar + name + open-on-YouTube" cell and the @handle-or-/channel/<id>
URL were copy-pasted across the channel manager, the discovery tab, the
subscribe notice and the player. Extract a single ChannelLink component
(optional in-app onView, middle-click opens YouTube) and a channelYouTubeUrl
helper, and route all four through them. Removes the NameCell / DiscoveryNameCell
duplication (the latter introduced with the discovery tab).
This commit is contained in:
npeter83 2026-06-19 03:22:10 +02:00
parent 795f21a1e1
commit 8c70d72e9a
6 changed files with 91 additions and 72 deletions

View file

@ -7,7 +7,7 @@ import { AlertTriangle, ArrowLeft, Check, CheckCheck, ExternalLink, SkipBack, Sk
import Avatar from "./Avatar";
import AddToPlaylist from "./AddToPlaylist";
import { api, type Video } from "../lib/api";
import { formatDuration, formatViews, relativeTime } from "../lib/format";
import { channelYouTubeUrl, formatDuration, formatViews, relativeTime } from "../lib/format";
// Turn a description into clickable nodes:
// - bare timestamps (mm:ss / hh:mm:ss) → seek the inline player
@ -572,7 +572,7 @@ export default function PlayerModal({
{navigated ? (
detail.data?.channel_id ? (
<a
href={`https://www.youtube.com/channel/${detail.data.channel_id}`}
href={channelYouTubeUrl(detail.data.channel_id)}
target="_blank"
rel="noreferrer"
className="font-medium hover:text-accent shrink-0"