mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
add table header icons for discNumber and trackNumber, refactor sizing
This commit is contained in:
@@ -191,23 +191,54 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.header-content {
|
.header-content {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
font-size: var(--theme-font-size-sm);
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-content.center {
|
.header-content.center {
|
||||||
|
justify-content: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-content.left {
|
.header-content.left {
|
||||||
|
justify-content: flex-start;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-content.right {
|
.header-content.right {
|
||||||
|
justify-content: flex-end;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.header-icon-wrapper {
|
||||||
|
display: inline-flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-items: center;
|
||||||
|
font-size: var(--theme-font-size-sm);
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-icon-wrapper :global(svg) {
|
||||||
|
width: var(--theme-font-size-sm);
|
||||||
|
height: var(--theme-font-size-sm);
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-content.center .header-icon-wrapper {
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-content.left .header-icon-wrapper {
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-content.right .header-icon-wrapper {
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
.container :global(.hover-only),
|
.container :global(.hover-only),
|
||||||
.container :global(.hover-only-flex) {
|
.container :global(.hover-only-flex) {
|
||||||
display: none;
|
display: none;
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import { TitleCombinedColumn } from '/@/renderer/components/item-list/item-table
|
|||||||
import { TableItemProps } from '/@/renderer/components/item-list/item-table-list/item-table-list';
|
import { TableItemProps } from '/@/renderer/components/item-list/item-table-list/item-table-list';
|
||||||
import { ItemControls, ItemListItem } from '/@/renderer/components/item-list/types';
|
import { ItemControls, ItemListItem } from '/@/renderer/components/item-list/types';
|
||||||
import { useDragDrop } from '/@/renderer/hooks/use-drag-drop';
|
import { useDragDrop } from '/@/renderer/hooks/use-drag-drop';
|
||||||
|
import { Flex } from '/@/shared/components/flex/flex';
|
||||||
import { Icon } from '/@/shared/components/icon/icon';
|
import { Icon } from '/@/shared/components/icon/icon';
|
||||||
import { Skeleton } from '/@/shared/components/skeleton/skeleton';
|
import { Skeleton } from '/@/shared/components/skeleton/skeleton';
|
||||||
import { Text } from '/@/shared/components/text/text';
|
import { Text } from '/@/shared/components/text/text';
|
||||||
@@ -653,7 +654,7 @@ export const TableColumnHeaderContainer = (
|
|||||||
},
|
},
|
||||||
) => {
|
) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<Flex
|
||||||
className={clsx(styles.container, styles.headerContainer, props.containerClassName, {
|
className={clsx(styles.container, styles.headerContainer, props.containerClassName, {
|
||||||
[styles.paddingLg]: props.cellPadding === 'lg',
|
[styles.paddingLg]: props.cellPadding === 'lg',
|
||||||
[styles.paddingMd]: props.cellPadding === 'md',
|
[styles.paddingMd]: props.cellPadding === 'md',
|
||||||
@@ -673,12 +674,16 @@ export const TableColumnHeaderContainer = (
|
|||||||
>
|
>
|
||||||
{columnLabelMap[props.type]}
|
{columnLabelMap[props.type]}
|
||||||
</Text>
|
</Text>
|
||||||
</div>
|
</Flex>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const columnLabelMap: Record<TableColumn, ReactNode | string> = {
|
const columnLabelMap: Record<TableColumn, ReactNode | string> = {
|
||||||
[TableColumn.ACTIONS]: <Icon fill="default" icon="ellipsisHorizontal" size="md" />,
|
[TableColumn.ACTIONS]: (
|
||||||
|
<Flex className={styles.headerIconWrapper}>
|
||||||
|
<Icon fill="default" icon="ellipsisHorizontal" />
|
||||||
|
</Flex>
|
||||||
|
),
|
||||||
[TableColumn.ALBUM]: i18n.t('table.column.album', { postProcess: 'upperCase' }) as string,
|
[TableColumn.ALBUM]: i18n.t('table.column.album', { postProcess: 'upperCase' }) as string,
|
||||||
[TableColumn.ALBUM_ARTIST]: i18n.t('table.column.albumArtist', {
|
[TableColumn.ALBUM_ARTIST]: i18n.t('table.column.albumArtist', {
|
||||||
postProcess: 'upperCase',
|
postProcess: 'upperCase',
|
||||||
@@ -698,10 +703,16 @@ const columnLabelMap: Record<TableColumn, ReactNode | string> = {
|
|||||||
[TableColumn.DATE_ADDED]: i18n.t('table.column.dateAdded', {
|
[TableColumn.DATE_ADDED]: i18n.t('table.column.dateAdded', {
|
||||||
postProcess: 'upperCase',
|
postProcess: 'upperCase',
|
||||||
}) as string,
|
}) as string,
|
||||||
[TableColumn.DISC_NUMBER]: i18n.t('table.column.discNumber', {
|
[TableColumn.DISC_NUMBER]: (
|
||||||
postProcess: 'upperCase',
|
<Flex className={styles.headerIconWrapper}>
|
||||||
}) as string,
|
<Icon icon="disc" />
|
||||||
[TableColumn.DURATION]: <Icon icon="duration" size="md" />,
|
</Flex>
|
||||||
|
),
|
||||||
|
[TableColumn.DURATION]: (
|
||||||
|
<Flex className={styles.headerIconWrapper}>
|
||||||
|
<Icon icon="duration" />
|
||||||
|
</Flex>
|
||||||
|
),
|
||||||
[TableColumn.GENRE]: i18n.t('table.column.genre', { postProcess: 'upperCase' }) as string,
|
[TableColumn.GENRE]: i18n.t('table.column.genre', { postProcess: 'upperCase' }) as string,
|
||||||
[TableColumn.GENRE_BADGE]: i18n.t('table.column.genre', {
|
[TableColumn.GENRE_BADGE]: i18n.t('table.column.genre', {
|
||||||
postProcess: 'upperCase',
|
postProcess: 'upperCase',
|
||||||
@@ -719,7 +730,11 @@ const columnLabelMap: Record<TableColumn, ReactNode | string> = {
|
|||||||
[TableColumn.RELEASE_DATE]: i18n.t('table.column.releaseDate', {
|
[TableColumn.RELEASE_DATE]: i18n.t('table.column.releaseDate', {
|
||||||
postProcess: 'upperCase',
|
postProcess: 'upperCase',
|
||||||
}) as string,
|
}) as string,
|
||||||
[TableColumn.ROW_INDEX]: <Icon icon="hash" size="md" />,
|
[TableColumn.ROW_INDEX]: (
|
||||||
|
<Flex className={styles.headerIconWrapper}>
|
||||||
|
<Icon icon="hash" />
|
||||||
|
</Flex>
|
||||||
|
),
|
||||||
[TableColumn.SIZE]: i18n.t('table.column.size', { postProcess: 'upperCase' }) as string,
|
[TableColumn.SIZE]: i18n.t('table.column.size', { postProcess: 'upperCase' }) as string,
|
||||||
[TableColumn.SKIP]: '',
|
[TableColumn.SKIP]: '',
|
||||||
[TableColumn.SONG_COUNT]: i18n.t('table.column.songCount', {
|
[TableColumn.SONG_COUNT]: i18n.t('table.column.songCount', {
|
||||||
@@ -729,10 +744,16 @@ const columnLabelMap: Record<TableColumn, ReactNode | string> = {
|
|||||||
[TableColumn.TITLE_COMBINED]: i18n.t('table.column.title', {
|
[TableColumn.TITLE_COMBINED]: i18n.t('table.column.title', {
|
||||||
postProcess: 'upperCase',
|
postProcess: 'upperCase',
|
||||||
}) as string,
|
}) as string,
|
||||||
[TableColumn.TRACK_NUMBER]: i18n.t('table.column.trackNumber', {
|
[TableColumn.TRACK_NUMBER]: (
|
||||||
postProcess: 'upperCase',
|
<Flex className={styles.headerIconWrapper}>
|
||||||
}) as string,
|
<Icon icon="itemSong" />
|
||||||
[TableColumn.USER_FAVORITE]: <Icon icon="favorite" size="md" />,
|
</Flex>
|
||||||
|
),
|
||||||
|
[TableColumn.USER_FAVORITE]: (
|
||||||
|
<Flex className={styles.headerIconWrapper}>
|
||||||
|
<Icon icon="favorite" />
|
||||||
|
</Flex>
|
||||||
|
),
|
||||||
[TableColumn.USER_RATING]: i18n.t('table.column.rating', {
|
[TableColumn.USER_RATING]: i18n.t('table.column.rating', {
|
||||||
postProcess: 'upperCase',
|
postProcess: 'upperCase',
|
||||||
}) as string,
|
}) as string,
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import {
|
|||||||
LuCloudDownload,
|
LuCloudDownload,
|
||||||
LuCornerUpRight,
|
LuCornerUpRight,
|
||||||
LuDelete,
|
LuDelete,
|
||||||
|
LuDisc,
|
||||||
LuDisc3,
|
LuDisc3,
|
||||||
LuDownload,
|
LuDownload,
|
||||||
LuEllipsis,
|
LuEllipsis,
|
||||||
@@ -141,6 +142,7 @@ export const AppIcon = {
|
|||||||
check: LuCheck,
|
check: LuCheck,
|
||||||
clipboardCopy: LuClipboardCopy,
|
clipboardCopy: LuClipboardCopy,
|
||||||
delete: LuDelete,
|
delete: LuDelete,
|
||||||
|
disc: LuDisc,
|
||||||
download: LuDownload,
|
download: LuDownload,
|
||||||
dragHorizontal: LuGripHorizontal,
|
dragHorizontal: LuGripHorizontal,
|
||||||
dragVertical: LuGripVertical,
|
dragVertical: LuGripVertical,
|
||||||
|
|||||||
Reference in New Issue
Block a user