use clearer separator character
This commit is contained in:
parent
19a88fea86
commit
ec69cc22f9
8 changed files with 31 additions and 41 deletions
|
@ -47,3 +47,5 @@ export const hasFeature = (server: ServerListItem | null, feature: ServerFeature
|
||||||
|
|
||||||
return server.features[feature] ?? false;
|
return server.features[feature] ?? false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const SEPARATOR_STRING = ' · ';
|
||||||
|
|
15
src/renderer/components/separator/index.tsx
Normal file
15
src/renderer/components/separator/index.tsx
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
import { SEPARATOR_STRING } from '/@/renderer/api/utils';
|
||||||
|
import { Text } from '/@/renderer/components/text';
|
||||||
|
|
||||||
|
export const Separator = () => {
|
||||||
|
return (
|
||||||
|
<Text
|
||||||
|
$noSelect
|
||||||
|
$secondary
|
||||||
|
size="md"
|
||||||
|
style={{ display: 'inline-block', padding: '0px 3px' }}
|
||||||
|
>
|
||||||
|
{SEPARATOR_STRING}
|
||||||
|
</Text>
|
||||||
|
);
|
||||||
|
};
|
|
@ -7,6 +7,7 @@ import { Text } from '/@/renderer/components/text';
|
||||||
import { CellContainer } from '/@/renderer/components/virtual-table/cells/generic-cell';
|
import { CellContainer } from '/@/renderer/components/virtual-table/cells/generic-cell';
|
||||||
import { AppRoute } from '/@/renderer/router/routes';
|
import { AppRoute } from '/@/renderer/router/routes';
|
||||||
import { Skeleton } from '/@/renderer/components/skeleton';
|
import { Skeleton } from '/@/renderer/components/skeleton';
|
||||||
|
import { Separator } from '/@/renderer/components/separator';
|
||||||
|
|
||||||
export const AlbumArtistCell = ({ value, data }: ICellRendererParams) => {
|
export const AlbumArtistCell = ({ value, data }: ICellRendererParams) => {
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
|
@ -29,15 +30,7 @@ export const AlbumArtistCell = ({ value, data }: ICellRendererParams) => {
|
||||||
>
|
>
|
||||||
{value?.map((item: Artist | AlbumArtist, index: number) => (
|
{value?.map((item: Artist | AlbumArtist, index: number) => (
|
||||||
<React.Fragment key={`row-${item.id}-${data.uniqueId}`}>
|
<React.Fragment key={`row-${item.id}-${data.uniqueId}`}>
|
||||||
{index > 0 && (
|
{index > 0 && <Separator />}
|
||||||
<Text
|
|
||||||
$secondary
|
|
||||||
size="md"
|
|
||||||
style={{ display: 'inline-block' }}
|
|
||||||
>
|
|
||||||
,
|
|
||||||
</Text>
|
|
||||||
)}{' '}
|
|
||||||
{item.id ? (
|
{item.id ? (
|
||||||
<Text
|
<Text
|
||||||
$link
|
$link
|
||||||
|
|
|
@ -7,6 +7,7 @@ import { Text } from '/@/renderer/components/text';
|
||||||
import { CellContainer } from '/@/renderer/components/virtual-table/cells/generic-cell';
|
import { CellContainer } from '/@/renderer/components/virtual-table/cells/generic-cell';
|
||||||
import { AppRoute } from '/@/renderer/router/routes';
|
import { AppRoute } from '/@/renderer/router/routes';
|
||||||
import { Skeleton } from '/@/renderer/components/skeleton';
|
import { Skeleton } from '/@/renderer/components/skeleton';
|
||||||
|
import { Separator } from '/@/renderer/components/separator';
|
||||||
|
|
||||||
export const ArtistCell = ({ value, data }: ICellRendererParams) => {
|
export const ArtistCell = ({ value, data }: ICellRendererParams) => {
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
|
@ -29,15 +30,7 @@ export const ArtistCell = ({ value, data }: ICellRendererParams) => {
|
||||||
>
|
>
|
||||||
{value?.map((item: Artist | AlbumArtist, index: number) => (
|
{value?.map((item: Artist | AlbumArtist, index: number) => (
|
||||||
<React.Fragment key={`row-${item.id}-${data.uniqueId}`}>
|
<React.Fragment key={`row-${item.id}-${data.uniqueId}`}>
|
||||||
{index > 0 && (
|
{index > 0 && <Separator />}
|
||||||
<Text
|
|
||||||
$secondary
|
|
||||||
size="md"
|
|
||||||
style={{ display: 'inline-block' }}
|
|
||||||
>
|
|
||||||
,
|
|
||||||
</Text>
|
|
||||||
)}{' '}
|
|
||||||
{item.id ? (
|
{item.id ? (
|
||||||
<Text
|
<Text
|
||||||
$link
|
$link
|
||||||
|
|
|
@ -11,6 +11,7 @@ import type { AlbumArtist, Artist } from '/@/renderer/api/types';
|
||||||
import { Text } from '/@/renderer/components/text';
|
import { Text } from '/@/renderer/components/text';
|
||||||
import { AppRoute } from '/@/renderer/router/routes';
|
import { AppRoute } from '/@/renderer/router/routes';
|
||||||
import { Skeleton } from '/@/renderer/components/skeleton';
|
import { Skeleton } from '/@/renderer/components/skeleton';
|
||||||
|
import { SEPARATOR_STRING } from '/@/renderer/api/utils';
|
||||||
|
|
||||||
const CellContainer = styled(motion.div)<{ height: number }>`
|
const CellContainer = styled(motion.div)<{ height: number }>`
|
||||||
display: grid;
|
display: grid;
|
||||||
|
@ -118,7 +119,7 @@ export const CombinedTitleCell = ({ value, rowIndex, node }: ICellRendererParams
|
||||||
{artists?.length ? (
|
{artists?.length ? (
|
||||||
artists.map((artist: Artist | AlbumArtist, index: number) => (
|
artists.map((artist: Artist | AlbumArtist, index: number) => (
|
||||||
<React.Fragment key={`queue-${rowIndex}-artist-${artist.id}`}>
|
<React.Fragment key={`queue-${rowIndex}-artist-${artist.id}`}>
|
||||||
{index > 0 ? ', ' : null}
|
{index > 0 ? SEPARATOR_STRING : null}
|
||||||
{artist.id ? (
|
{artist.id ? (
|
||||||
<Text
|
<Text
|
||||||
$link
|
$link
|
||||||
|
|
|
@ -5,6 +5,7 @@ import type { AlbumArtist, Artist } from '/@/renderer/api/types';
|
||||||
import { Text } from '/@/renderer/components/text';
|
import { Text } from '/@/renderer/components/text';
|
||||||
import { CellContainer } from '/@/renderer/components/virtual-table/cells/generic-cell';
|
import { CellContainer } from '/@/renderer/components/virtual-table/cells/generic-cell';
|
||||||
import { AppRoute } from '/@/renderer/router/routes';
|
import { AppRoute } from '/@/renderer/router/routes';
|
||||||
|
import { Separator } from '/@/renderer/components/separator';
|
||||||
|
|
||||||
export const GenreCell = ({ value, data }: ICellRendererParams) => {
|
export const GenreCell = ({ value, data }: ICellRendererParams) => {
|
||||||
return (
|
return (
|
||||||
|
@ -16,15 +17,7 @@ export const GenreCell = ({ value, data }: ICellRendererParams) => {
|
||||||
>
|
>
|
||||||
{value?.map((item: Artist | AlbumArtist, index: number) => (
|
{value?.map((item: Artist | AlbumArtist, index: number) => (
|
||||||
<React.Fragment key={`row-${item.id}-${data.uniqueId}`}>
|
<React.Fragment key={`row-${item.id}-${data.uniqueId}`}>
|
||||||
{index > 0 && (
|
{index > 0 && <Separator />}
|
||||||
<Text
|
|
||||||
$secondary
|
|
||||||
size="md"
|
|
||||||
style={{ display: 'inline-block' }}
|
|
||||||
>
|
|
||||||
,
|
|
||||||
</Text>
|
|
||||||
)}{' '}
|
|
||||||
<Text
|
<Text
|
||||||
$link
|
$link
|
||||||
$secondary
|
$secondary
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { replaceURLWithHTMLLinks } from '/@/renderer/utils/linkify';
|
||||||
import { Rating, Spoiler } from '/@/renderer/components';
|
import { Rating, Spoiler } from '/@/renderer/components';
|
||||||
import { sanitize } from '/@/renderer/utils/sanitize';
|
import { sanitize } from '/@/renderer/utils/sanitize';
|
||||||
import { SongPath } from '/@/renderer/features/item-details/components/song-path';
|
import { SongPath } from '/@/renderer/features/item-details/components/song-path';
|
||||||
|
import { SEPARATOR_STRING } from '/@/renderer/api/utils';
|
||||||
|
|
||||||
export type ItemDetailsModalProps = {
|
export type ItemDetailsModalProps = {
|
||||||
item: Album | AlbumArtist | Song;
|
item: Album | AlbumArtist | Song;
|
||||||
|
@ -43,7 +44,7 @@ const handleRow = <T extends AnyLibraryItem>(t: TFunction, item: T, rule: ItemDe
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatArtists = (item: Album | Song) =>
|
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) =>
|
const formatComment = (item: Album | Song) =>
|
||||||
item.comment ? <Spoiler maxHeight={50}>{replaceURLWithHTMLLinks(item.comment)}</Spoiler> : null;
|
item.comment ? <Spoiler maxHeight={50}>{replaceURLWithHTMLLinks(item.comment)}</Spoiler> : null;
|
||||||
|
@ -51,7 +52,7 @@ const formatComment = (item: Album | Song) =>
|
||||||
const formatDate = (key: string | null) => (key ? dayjs(key).fromNow() : '');
|
const formatDate = (key: string | null) => (key ? dayjs(key).fromNow() : '');
|
||||||
|
|
||||||
const formatGenre = (item: Album | AlbumArtist | Song) =>
|
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) =>
|
const formatRating = (item: Album | AlbumArtist | Song) =>
|
||||||
item.userRating !== null ? (
|
item.userRating !== null ? (
|
||||||
|
@ -162,7 +163,7 @@ const SongPropertyMapping: ItemDetailRow<Song>[] = [
|
||||||
{
|
{
|
||||||
key: 'artists',
|
key: 'artists',
|
||||||
label: 'entity.artist_other',
|
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: 'album', label: 'entity.album_one' },
|
||||||
{ key: 'discNumber', label: 'common.disc' },
|
{ key: 'discNumber', label: 'common.disc' },
|
||||||
|
|
|
@ -20,6 +20,7 @@ import { fadeIn } from '/@/renderer/styles';
|
||||||
import { LibraryItem } from '/@/renderer/api/types';
|
import { LibraryItem } from '/@/renderer/api/types';
|
||||||
import { SONG_CONTEXT_MENU_ITEMS } from '/@/renderer/features/context-menu/context-menu-items';
|
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 { useHandleGeneralContextMenu } from '/@/renderer/features/context-menu/hooks/use-handle-context-menu';
|
||||||
|
import { Separator } from '/@/renderer/components/separator';
|
||||||
|
|
||||||
const ImageWrapper = styled.div`
|
const ImageWrapper = styled.div`
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -236,16 +237,7 @@ export const LeftControls = () => {
|
||||||
<LineItem $secondary>
|
<LineItem $secondary>
|
||||||
{artists?.map((artist, index) => (
|
{artists?.map((artist, index) => (
|
||||||
<React.Fragment key={`bar-${artist.id}`}>
|
<React.Fragment key={`bar-${artist.id}`}>
|
||||||
{index > 0 && (
|
{index > 0 && <Separator />}
|
||||||
<Text
|
|
||||||
$link
|
|
||||||
$secondary
|
|
||||||
size="md"
|
|
||||||
style={{ display: 'inline-block' }}
|
|
||||||
>
|
|
||||||
,
|
|
||||||
</Text>
|
|
||||||
)}{' '}
|
|
||||||
<Text
|
<Text
|
||||||
$link
|
$link
|
||||||
component={Link}
|
component={Link}
|
||||||
|
|
Reference in a new issue