fix(web): hide browser URL preview for player artists
ci / ts / ts (packages + web) (push) Successful in 4m37s
ci / ts / ts (packages + web) (push) Successful in 4m37s
This commit is contained in:
1 parent
7fa7ee2c7d
commit
eed7038109
3 files changed
+36
-7
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import type { components } from '@pipu/api-client';
|
||||
import { unwrap } from '@pipu/core';
|
||||
import { Link } from '@tanstack/react-router';
|
||||
import { Link, useNavigate } from '@tanstack/react-router';
|
||||
import { useVirtualizer } from '@tanstack/react-virtual';
|
||||
import { Fragment, useRef, useState, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
||||
import { AddToPlaylist } from './playlists';
|
||||
@@ -71,15 +71,19 @@ export function Cover({
|
||||
}
|
||||
|
||||
/** Исполнители через запятую, каждый — ссылка. */
|
||||
export function ArtistLinks({ artists }: { artists: ArtistRef[] }) {
|
||||
export function ArtistLinks({ artists, hideUrlPreview = false }: { artists: ArtistRef[]; hideUrlPreview?: boolean }) {
|
||||
const navigate = useNavigate();
|
||||
return (
|
||||
<>
|
||||
{artists.map((a, i) => (
|
||||
<Fragment key={a.id}>
|
||||
{i > 0 && ', '}
|
||||
<Link to="/artist/$id" params={{ id: a.id }} className={s.link}>
|
||||
{hideUrlPreview ? <button type="button" role="link" className={s.link}
|
||||
onClick={() => void navigate({ to: '/artist/$id', params: { id: a.id } })}>
|
||||
{a.name}
|
||||
</Link>
|
||||
</button> : <Link to="/artist/$id" params={{ id: a.id }} className={s.link}>
|
||||
{a.name}
|
||||
</Link>}
|
||||
</Fragment>
|
||||
))}
|
||||
</>
|
||||
|
||||
Reference in new issue
Block a user