mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
add external song indicator for queue
This commit is contained in:
+1
-3
@@ -5,8 +5,6 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.text-container {
|
.text-container {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-rows: 1fr 1fr;
|
grid-template-rows: 1fr 1fr;
|
||||||
@@ -43,7 +41,6 @@ a.title {
|
|||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.artists {
|
.artists {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -65,3 +62,4 @@ a.title {
|
|||||||
.active {
|
.active {
|
||||||
color: var(--theme-colors-primary);
|
color: var(--theme-colors-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,9 +14,10 @@ import {
|
|||||||
import { useIsActiveRow } from '/@/renderer/components/item-list/item-table-list/item-table-list-context';
|
import { useIsActiveRow } from '/@/renderer/components/item-list/item-table-list/item-table-list-context';
|
||||||
import { JoinedArtists } from '/@/renderer/features/albums/components/joined-artists';
|
import { JoinedArtists } from '/@/renderer/features/albums/components/joined-artists';
|
||||||
import { ExplicitIndicator } from '/@/shared/components/explicit-indicator/explicit-indicator';
|
import { ExplicitIndicator } from '/@/shared/components/explicit-indicator/explicit-indicator';
|
||||||
|
import { ExternalSongIndicator } from '/@/shared/components/external-song-indicator/external-song-indicator';
|
||||||
import { Icon } from '/@/shared/components/icon/icon';
|
import { Icon } from '/@/shared/components/icon/icon';
|
||||||
import { Text } from '/@/shared/components/text/text';
|
import { Text } from '/@/shared/components/text/text';
|
||||||
import { Folder, LibraryItem, QueueSong } from '/@/shared/types/domain-types';
|
import { Folder, LibraryItem, QueueSong, ServerType } from '/@/shared/types/domain-types';
|
||||||
|
|
||||||
export const DefaultTitleArtistColumn = (props: ItemTableListInnerColumn) => {
|
export const DefaultTitleArtistColumn = (props: ItemTableListInnerColumn) => {
|
||||||
const rowItem = props.getRowItem?.(props.rowIndex) ?? (props.data as any[])[props.rowIndex];
|
const rowItem = props.getRowItem?.(props.rowIndex) ?? (props.data as any[])[props.rowIndex];
|
||||||
@@ -54,6 +55,10 @@ export const DefaultTitleArtistColumn = (props: ItemTableListInnerColumn) => {
|
|||||||
>
|
>
|
||||||
<Text className={styles.title} isNoSelect size="md" {...titleLinkProps}>
|
<Text className={styles.title} isNoSelect size="md" {...titleLinkProps}>
|
||||||
<ExplicitIndicator explicitStatus={item?.explicitStatus} />
|
<ExplicitIndicator explicitStatus={item?.explicitStatus} />
|
||||||
|
<ExternalSongIndicator
|
||||||
|
isExternal={item?._serverType === ServerType.EXTERNAL}
|
||||||
|
size="sm"
|
||||||
|
/>
|
||||||
{item.name as string}
|
{item.name as string}
|
||||||
</Text>
|
</Text>
|
||||||
<div className={styles.artists}>
|
<div className={styles.artists}>
|
||||||
@@ -123,6 +128,10 @@ export const QueueSongTitleArtistColumn = (props: ItemTableListInnerColumn) => {
|
|||||||
{...titleLinkProps}
|
{...titleLinkProps}
|
||||||
>
|
>
|
||||||
<ExplicitIndicator explicitStatus={song?.explicitStatus} />
|
<ExplicitIndicator explicitStatus={song?.explicitStatus} />
|
||||||
|
<ExternalSongIndicator
|
||||||
|
isExternal={song?._serverType === ServerType.EXTERNAL}
|
||||||
|
size="sm"
|
||||||
|
/>
|
||||||
{row.name as string}
|
{row.name as string}
|
||||||
{song?.trackSubtitle && props.itemType !== LibraryItem.QUEUE_SONG && (
|
{song?.trackSubtitle && props.itemType !== LibraryItem.QUEUE_SONG && (
|
||||||
<Text
|
<Text
|
||||||
|
|||||||
@@ -23,3 +23,4 @@ a.name-container {
|
|||||||
.active {
|
.active {
|
||||||
color: var(--theme-colors-primary);
|
color: var(--theme-colors-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,9 @@ import {
|
|||||||
} from '/@/renderer/components/item-list/item-table-list/item-table-list-column';
|
} from '/@/renderer/components/item-list/item-table-list/item-table-list-column';
|
||||||
import { useIsActiveRow } from '/@/renderer/components/item-list/item-table-list/item-table-list-context';
|
import { useIsActiveRow } from '/@/renderer/components/item-list/item-table-list/item-table-list-context';
|
||||||
import { ExplicitIndicator } from '/@/shared/components/explicit-indicator/explicit-indicator';
|
import { ExplicitIndicator } from '/@/shared/components/explicit-indicator/explicit-indicator';
|
||||||
|
import { ExternalSongIndicator } from '/@/shared/components/external-song-indicator/external-song-indicator';
|
||||||
import { Text } from '/@/shared/components/text/text';
|
import { Text } from '/@/shared/components/text/text';
|
||||||
import { LibraryItem, QueueSong } from '/@/shared/types/domain-types';
|
import { LibraryItem, QueueSong, ServerType } from '/@/shared/types/domain-types';
|
||||||
|
|
||||||
const TitleColumnBase = (props: ItemTableListInnerColumn) => {
|
const TitleColumnBase = (props: ItemTableListInnerColumn) => {
|
||||||
const { itemType } = props;
|
const { itemType } = props;
|
||||||
@@ -60,6 +61,10 @@ function DefaultTitleColumn(props: ItemTableListInnerColumn) {
|
|||||||
{...titleLinkProps}
|
{...titleLinkProps}
|
||||||
>
|
>
|
||||||
<ExplicitIndicator explicitStatus={item?.explicitStatus} />
|
<ExplicitIndicator explicitStatus={item?.explicitStatus} />
|
||||||
|
<ExternalSongIndicator
|
||||||
|
isExternal={item?._serverType === ServerType.EXTERNAL}
|
||||||
|
size="sm"
|
||||||
|
/>
|
||||||
{row}
|
{row}
|
||||||
</Text>
|
</Text>
|
||||||
</TableColumnContainer>
|
</TableColumnContainer>
|
||||||
@@ -106,6 +111,7 @@ function QueueSongTitleColumn(props: ItemTableListInnerColumn) {
|
|||||||
{...titleLinkProps}
|
{...titleLinkProps}
|
||||||
>
|
>
|
||||||
<ExplicitIndicator explicitStatus={song?.explicitStatus} />
|
<ExplicitIndicator explicitStatus={song?.explicitStatus} />
|
||||||
|
<ExternalSongIndicator isExternal={song?._serverType === ServerType.EXTERNAL} />
|
||||||
{row}
|
{row}
|
||||||
{song?.trackSubtitle && props.itemType !== LibraryItem.QUEUE_SONG && (
|
{song?.trackSubtitle && props.itemType !== LibraryItem.QUEUE_SONG && (
|
||||||
<Text
|
<Text
|
||||||
|
|||||||
+1
-1
@@ -42,7 +42,6 @@ a.title {
|
|||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.artists {
|
.artists {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -94,3 +93,4 @@ a.title {
|
|||||||
.active {
|
.active {
|
||||||
color: var(--theme-colors-primary);
|
color: var(--theme-colors-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-1
@@ -21,9 +21,10 @@ import {
|
|||||||
} from '/@/renderer/features/shared/components/play-button-group';
|
} from '/@/renderer/features/shared/components/play-button-group';
|
||||||
import { usePlayButtonBehavior } from '/@/renderer/store';
|
import { usePlayButtonBehavior } from '/@/renderer/store';
|
||||||
import { ExplicitIndicator } from '/@/shared/components/explicit-indicator/explicit-indicator';
|
import { ExplicitIndicator } from '/@/shared/components/explicit-indicator/explicit-indicator';
|
||||||
|
import { ExternalSongIndicator } from '/@/shared/components/external-song-indicator/external-song-indicator';
|
||||||
import { Icon } from '/@/shared/components/icon/icon';
|
import { Icon } from '/@/shared/components/icon/icon';
|
||||||
import { Text } from '/@/shared/components/text/text';
|
import { Text } from '/@/shared/components/text/text';
|
||||||
import { Folder, LibraryItem, QueueSong } from '/@/shared/types/domain-types';
|
import { Folder, LibraryItem, QueueSong, ServerType } from '/@/shared/types/domain-types';
|
||||||
import { Play } from '/@/shared/types/types';
|
import { Play } from '/@/shared/types/types';
|
||||||
|
|
||||||
export const DefaultTitleCombinedColumn = (props: ItemTableListInnerColumn) => {
|
export const DefaultTitleCombinedColumn = (props: ItemTableListInnerColumn) => {
|
||||||
@@ -143,6 +144,10 @@ export const DefaultTitleCombinedColumn = (props: ItemTableListInnerColumn) => {
|
|||||||
>
|
>
|
||||||
<Text className={styles.title} isNoSelect size="md" {...titleLinkProps}>
|
<Text className={styles.title} isNoSelect size="md" {...titleLinkProps}>
|
||||||
<ExplicitIndicator explicitStatus={item?.explicitStatus} />
|
<ExplicitIndicator explicitStatus={item?.explicitStatus} />
|
||||||
|
<ExternalSongIndicator
|
||||||
|
isExternal={item?._serverType === ServerType.EXTERNAL}
|
||||||
|
size="sm"
|
||||||
|
/>
|
||||||
{item.name as string}
|
{item.name as string}
|
||||||
</Text>
|
</Text>
|
||||||
<div className={styles.artists}>
|
<div className={styles.artists}>
|
||||||
@@ -294,6 +299,10 @@ export const QueueSongTitleCombinedColumn = (props: ItemTableListInnerColumn) =>
|
|||||||
{...titleLinkProps}
|
{...titleLinkProps}
|
||||||
>
|
>
|
||||||
<ExplicitIndicator explicitStatus={song?.explicitStatus} />
|
<ExplicitIndicator explicitStatus={song?.explicitStatus} />
|
||||||
|
<ExternalSongIndicator
|
||||||
|
isExternal={song?._serverType === ServerType.EXTERNAL}
|
||||||
|
size="sm"
|
||||||
|
/>
|
||||||
{row.name as string}
|
{row.name as string}
|
||||||
{song?.trackSubtitle && props.itemType !== LibraryItem.QUEUE_SONG && (
|
{song?.trackSubtitle && props.itemType !== LibraryItem.QUEUE_SONG && (
|
||||||
<Text
|
<Text
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
.root {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.with-space {
|
||||||
|
margin-right: var(--theme-spacing-xs);
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
import clsx from 'clsx';
|
||||||
|
import { ComponentPropsWithoutRef } from 'react';
|
||||||
|
|
||||||
|
import styles from './external-song-indicator.module.css';
|
||||||
|
|
||||||
|
import { Icon } from '/@/shared/components/icon/icon';
|
||||||
|
|
||||||
|
export interface ExternalSongIndicatorProps extends ComponentPropsWithoutRef<'span'> {
|
||||||
|
isExternal: boolean | null | undefined;
|
||||||
|
size?: 'lg' | 'md' | 'sm' | 'xl' | 'xs';
|
||||||
|
withSpace?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ExternalSongIndicator = ({
|
||||||
|
className,
|
||||||
|
isExternal,
|
||||||
|
size = 'lg',
|
||||||
|
withSpace = true,
|
||||||
|
...rest
|
||||||
|
}: ExternalSongIndicatorProps) => {
|
||||||
|
if (!isExternal) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<span
|
||||||
|
className={clsx(styles.root, className, {
|
||||||
|
[styles.withSpace]: withSpace,
|
||||||
|
})}
|
||||||
|
{...rest}
|
||||||
|
>
|
||||||
|
<Icon icon="externalSong" size={size} />
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -115,6 +115,7 @@ import {
|
|||||||
LuWifi,
|
LuWifi,
|
||||||
LuWifiOff,
|
LuWifiOff,
|
||||||
LuX,
|
LuX,
|
||||||
|
LuYoutube,
|
||||||
} from 'react-icons/lu';
|
} from 'react-icons/lu';
|
||||||
import { MdOutlineVisibility, MdOutlineVisibilityOff } from 'react-icons/md';
|
import { MdOutlineVisibility, MdOutlineVisibilityOff } from 'react-icons/md';
|
||||||
import { PiMouseLeftClickFill, PiMouseRightClickFill } from 'react-icons/pi';
|
import { PiMouseLeftClickFill, PiMouseRightClickFill } from 'react-icons/pi';
|
||||||
@@ -173,6 +174,7 @@ export const AppIcon = {
|
|||||||
error: LuShieldAlert,
|
error: LuShieldAlert,
|
||||||
expand: LuExpand,
|
expand: LuExpand,
|
||||||
externalLink: LuExternalLink,
|
externalLink: LuExternalLink,
|
||||||
|
externalSong: LuYoutube,
|
||||||
favorite: LuHeart,
|
favorite: LuHeart,
|
||||||
fileJson: LuFileJson,
|
fileJson: LuFileJson,
|
||||||
filter: LuListFilter,
|
filter: LuListFilter,
|
||||||
|
|||||||
Reference in New Issue
Block a user