mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-17 00:44:23 +02:00
use JoinedArtists in columns
This commit is contained in:
@@ -1,4 +1,28 @@
|
|||||||
import { ItemDetailListCellProps } from './types';
|
import { ItemDetailListCellProps } from './types';
|
||||||
|
|
||||||
export const AlbumArtistColumn = ({ song }: ItemDetailListCellProps) =>
|
import { JoinedArtists } from '/@/renderer/features/albums/components/joined-artists';
|
||||||
song.albumArtistName ?? <> </>;
|
import { Text } from '/@/shared/components/text/text';
|
||||||
|
|
||||||
|
export const AlbumArtistColumn = ({ isRowHovered, song }: ItemDetailListCellProps) => {
|
||||||
|
const name = song.albumArtistName?.trim() ?? '';
|
||||||
|
const hasArtists = name.length > 0 || (song.albumArtists?.length ?? 0) > 0;
|
||||||
|
|
||||||
|
if (!hasArtists) return <> </>;
|
||||||
|
|
||||||
|
if (!isRowHovered) {
|
||||||
|
return (
|
||||||
|
<Text component="span" isMuted size="sm">
|
||||||
|
{name}
|
||||||
|
</Text>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<JoinedArtists
|
||||||
|
artistName={song.albumArtistName ?? ''}
|
||||||
|
artists={song.albumArtists ?? []}
|
||||||
|
linkProps={{ fw: 400, isMuted: true }}
|
||||||
|
rootTextProps={{ fw: 400, isMuted: true, size: 'sm' }}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,3 +1,28 @@
|
|||||||
import { ItemDetailListCellProps } from './types';
|
import { ItemDetailListCellProps } from './types';
|
||||||
|
|
||||||
export const ArtistColumn = ({ song }: ItemDetailListCellProps) => song.artistName ?? <> </>;
|
import { JoinedArtists } from '/@/renderer/features/albums/components/joined-artists';
|
||||||
|
import { Text } from '/@/shared/components/text/text';
|
||||||
|
|
||||||
|
export const ArtistColumn = ({ isRowHovered, song }: ItemDetailListCellProps) => {
|
||||||
|
const name = song.artistName?.trim() ?? '';
|
||||||
|
const hasArtists = name.length > 0 || (song.artists?.length ?? 0) > 0;
|
||||||
|
|
||||||
|
if (!hasArtists) return <> </>;
|
||||||
|
|
||||||
|
if (!isRowHovered) {
|
||||||
|
return (
|
||||||
|
<Text component="span" isMuted size="sm">
|
||||||
|
{name}
|
||||||
|
</Text>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<JoinedArtists
|
||||||
|
artistName={song.artistName ?? ''}
|
||||||
|
artists={song.artists ?? []}
|
||||||
|
linkProps={{ fw: 400, isMuted: true }}
|
||||||
|
rootTextProps={{ fw: 400, isMuted: true, size: 'sm' }}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ export interface ItemDetailListCellProps {
|
|||||||
controls?: ItemControls;
|
controls?: ItemControls;
|
||||||
internalState?: ItemListStateActions;
|
internalState?: ItemListStateActions;
|
||||||
isMutatingFavorite?: boolean;
|
isMutatingFavorite?: boolean;
|
||||||
|
isRowHovered?: boolean;
|
||||||
onFavoriteClick?: (song: Song) => void;
|
onFavoriteClick?: (song: Song) => void;
|
||||||
rowIndex?: number;
|
rowIndex?: number;
|
||||||
size?: 'compact' | 'default' | 'large';
|
size?: 'compact' | 'default' | 'large';
|
||||||
|
|||||||
@@ -242,6 +242,7 @@ const TrackRow = memo(
|
|||||||
controls={controls}
|
controls={controls}
|
||||||
internalState={internalState}
|
internalState={internalState}
|
||||||
isMutatingFavorite={isMutatingFavorite}
|
isMutatingFavorite={isMutatingFavorite}
|
||||||
|
isRowHovered={isRowHovered}
|
||||||
onFavoriteClick={onFavoriteClick}
|
onFavoriteClick={onFavoriteClick}
|
||||||
rowIndex={rowIndex}
|
rowIndex={rowIndex}
|
||||||
size={size}
|
size={size}
|
||||||
|
|||||||
Reference in New Issue
Block a user