mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2025-01-20 03:32:44 +08:00
fix: 歌手页 & 歌手页链接 (#1434)
* fix: 禁止打开id为0的歌手页 * feat: 当歌手没有专辑时,不在歌手页中显示专辑 & 热门歌曲默认禁用滚动条 * fix * fix: 根据建议进行修改
This commit is contained in:
parent
36603dc3a0
commit
7ac084f73d
|
@ -10,8 +10,8 @@ const ArtistInline = ({
|
||||||
if (!artists) return <div></div>
|
if (!artists) return <div></div>
|
||||||
|
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
const handleClick = () => {
|
const handleClick = (id: number) => {
|
||||||
disableLink ? null : navigate(`/artist/${artists[0].id}`)
|
id !== 0 && !disableLink && navigate(`/artist/${id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -19,7 +19,7 @@ const ArtistInline = ({
|
||||||
{artists.map((artist, index) => (
|
{artists.map((artist, index) => (
|
||||||
<span key={`${artist.id}-${artist.name}`}>
|
<span key={`${artist.id}-${artist.name}`}>
|
||||||
<span
|
<span
|
||||||
onClick={handleClick}
|
onClick={() => handleClick(artist.id)}
|
||||||
className={classNames({
|
className={classNames({
|
||||||
'hover:underline': !!artist.id && !disableLink,
|
'hover:underline': !!artist.id && !disableLink,
|
||||||
})}
|
})}
|
||||||
|
|
|
@ -113,7 +113,7 @@ const Artist = () => {
|
||||||
<div className='mb-6 text-2xl font-semibold dark:text-white'>
|
<div className='mb-6 text-2xl font-semibold dark:text-white'>
|
||||||
热门歌曲
|
热门歌曲
|
||||||
</div>
|
</div>
|
||||||
<div className='overflow-scroll rounded-xl '>
|
<div className='rounded-xl'>
|
||||||
<TracksGrid
|
<TracksGrid
|
||||||
tracks={artist?.hotSongs.slice(0, 10) ?? []}
|
tracks={artist?.hotSongs.slice(0, 10) ?? []}
|
||||||
isSkeleton={isLoading}
|
isSkeleton={isLoading}
|
||||||
|
@ -123,13 +123,17 @@ const Artist = () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Albums */}
|
{/* Albums */}
|
||||||
|
{albums.length !== 0 && (
|
||||||
<div className='mt-20 px-2'>
|
<div className='mt-20 px-2'>
|
||||||
<div className='mb-6 text-2xl font-semibold dark:text-white'>专辑</div>
|
<div className='mb-6 text-2xl font-semibold dark:text-white'>
|
||||||
|
专辑
|
||||||
|
</div>
|
||||||
<CoverRow
|
<CoverRow
|
||||||
albums={albums.slice(0, 10)}
|
albums={albums.slice(0, 10)}
|
||||||
subtitle={Subtitle.TYPE_RELEASE_YEAR}
|
subtitle={Subtitle.TYPE_RELEASE_YEAR}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Singles/EP */}
|
{/* Singles/EP */}
|
||||||
<div className='mt-16 px-2'>
|
<div className='mt-16 px-2'>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user