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:
parent
96f303b0cf
commit
5461cada84
6 changed files with 91 additions and 72 deletions
|
|
@ -18,6 +18,7 @@ import {
|
|||
type VideoHiddenMeta,
|
||||
type VideoWatchedMeta,
|
||||
} from "../lib/notifications";
|
||||
import { channelYouTubeUrl } from "../lib/format";
|
||||
import type { Page } from "../lib/urlState";
|
||||
import { LEVEL_STYLE } from "./Toaster";
|
||||
|
||||
|
|
@ -380,7 +381,7 @@ function ClientActivityRow({
|
|||
{t("notifications.openInManager")}
|
||||
</button>
|
||||
<a
|
||||
href={`https://www.youtube.com/channel/${subscribed.channelId}`}
|
||||
href={channelYouTubeUrl(subscribed.channelId)}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center gap-1 text-accent text-sm font-semibold hover:underline"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue