diff --git a/src/renderer/api/utils.ts b/src/renderer/api/utils.ts index 8f10c869..c7ef7b58 100644 --- a/src/renderer/api/utils.ts +++ b/src/renderer/api/utils.ts @@ -47,3 +47,5 @@ export const hasFeature = (server: ServerListItem | null, feature: ServerFeature return server.features[feature] ?? false; }; + +export const SEPARATOR_STRING = ' · '; diff --git a/src/renderer/components/separator/index.tsx b/src/renderer/components/separator/index.tsx new file mode 100644 index 00000000..d1800fe5 --- /dev/null +++ b/src/renderer/components/separator/index.tsx @@ -0,0 +1,15 @@ +import { SEPARATOR_STRING } from '/@/renderer/api/utils'; +import { Text } from '/@/renderer/components/text'; + +export const Separator = () => { + return ( + + {SEPARATOR_STRING} + + ); +}; diff --git a/src/renderer/components/virtual-table/cells/album-artist-cell.tsx b/src/renderer/components/virtual-table/cells/album-artist-cell.tsx index 62b0e1a0..ea9a49f0 100644 --- a/src/renderer/components/virtual-table/cells/album-artist-cell.tsx +++ b/src/renderer/components/virtual-table/cells/album-artist-cell.tsx @@ -7,6 +7,7 @@ import { Text } from '/@/renderer/components/text'; import { CellContainer } from '/@/renderer/components/virtual-table/cells/generic-cell'; import { AppRoute } from '/@/renderer/router/routes'; import { Skeleton } from '/@/renderer/components/skeleton'; +import { Separator } from '/@/renderer/components/separator'; export const AlbumArtistCell = ({ value, data }: ICellRendererParams) => { if (value === undefined) { @@ -29,15 +30,7 @@ export const AlbumArtistCell = ({ value, data }: ICellRendererParams) => { > {value?.map((item: Artist | AlbumArtist, index: number) => ( - {index > 0 && ( - - , - - )}{' '} + {index > 0 && } {item.id ? ( { if (value === undefined) { @@ -29,15 +30,7 @@ export const ArtistCell = ({ value, data }: ICellRendererParams) => { > {value?.map((item: Artist | AlbumArtist, index: number) => ( - {index > 0 && ( - - , - - )}{' '} + {index > 0 && } {item.id ? ( ` display: grid; @@ -118,7 +119,7 @@ export const CombinedTitleCell = ({ value, rowIndex, node }: ICellRendererParams {artists?.length ? ( artists.map((artist: Artist | AlbumArtist, index: number) => ( - {index > 0 ? ', ' : null} + {index > 0 ? SEPARATOR_STRING : null} {artist.id ? ( { return ( @@ -16,15 +17,7 @@ export const GenreCell = ({ value, data }: ICellRendererParams) => { > {value?.map((item: Artist | AlbumArtist, index: number) => ( - {index > 0 && ( - - , - - )}{' '} + {index > 0 && } (t: TFunction, item: T, rule: ItemDe }; const formatArtists = (item: Album | Song) => - item.albumArtists?.map((artist) => artist.name).join(' · '); + item.albumArtists?.map((artist) => artist.name).join(SEPARATOR_STRING); const formatComment = (item: Album | Song) => item.comment ? {replaceURLWithHTMLLinks(item.comment)} : null; @@ -51,7 +52,7 @@ const formatComment = (item: Album | Song) => const formatDate = (key: string | null) => (key ? dayjs(key).fromNow() : ''); const formatGenre = (item: Album | AlbumArtist | Song) => - item.genres?.map((genre) => genre.name).join(' · '); + item.genres?.map((genre) => genre.name).join(SEPARATOR_STRING); const formatRating = (item: Album | AlbumArtist | Song) => item.userRating !== null ? ( @@ -162,7 +163,7 @@ const SongPropertyMapping: ItemDetailRow[] = [ { key: 'artists', label: 'entity.artist_other', - render: (song) => song.artists.map((artist) => artist.name).join(' · '), + render: (song) => song.artists.map((artist) => artist.name).join(SEPARATOR_STRING), }, { key: 'album', label: 'entity.album_one' }, { key: 'discNumber', label: 'common.disc' }, diff --git a/src/renderer/features/player/components/left-controls.tsx b/src/renderer/features/player/components/left-controls.tsx index 928f005e..70076b28 100644 --- a/src/renderer/features/player/components/left-controls.tsx +++ b/src/renderer/features/player/components/left-controls.tsx @@ -20,6 +20,7 @@ import { fadeIn } from '/@/renderer/styles'; import { LibraryItem } from '/@/renderer/api/types'; import { SONG_CONTEXT_MENU_ITEMS } from '/@/renderer/features/context-menu/context-menu-items'; import { useHandleGeneralContextMenu } from '/@/renderer/features/context-menu/hooks/use-handle-context-menu'; +import { Separator } from '/@/renderer/components/separator'; const ImageWrapper = styled.div` position: relative; @@ -236,16 +237,7 @@ export const LeftControls = () => { {artists?.map((artist, index) => ( - {index > 0 && ( - - , - - )}{' '} + {index > 0 && }