mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-14 12:30:06 +02:00
migrate to mantine v9
This commit is contained in:
@@ -385,8 +385,8 @@ const BaseItemGridList = ({
|
||||
rows,
|
||||
size = 'default',
|
||||
}: ItemGridListProps) => {
|
||||
const rootRef = useRef(null);
|
||||
const outerRef = useRef(null);
|
||||
const rootRef = useRef<HTMLDivElement | null>(null);
|
||||
const outerRef = useRef<HTMLDivElement | null>(null);
|
||||
const listRef = useRef<FixedSizeList<GridItemProps>>(null);
|
||||
const { ref: containerRef, width: containerWidth } = useElementSize();
|
||||
const { focused, ref: containerFocusRef } = useFocusWithin();
|
||||
@@ -486,7 +486,7 @@ const BaseItemGridList = ({
|
||||
}, [itemsPerRow, rows?.length, size]);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
const { current: container } = containerRef;
|
||||
const container = rootRef.current;
|
||||
if (!container) return;
|
||||
|
||||
throttledSetTableMeta(containerWidth, resolvedItemCount, (meta) => {
|
||||
@@ -500,13 +500,15 @@ const BaseItemGridList = ({
|
||||
current.rowCount !== meta.rowCount
|
||||
) {
|
||||
tableMetaRef.current = meta;
|
||||
container.style.setProperty('--grid-column-count', String(meta.columnCount));
|
||||
container.style.setProperty('--grid-item-height', `${meta.itemHeight}px`);
|
||||
container.style.setProperty('--grid-row-count', String(meta.rowCount));
|
||||
const el = rootRef.current;
|
||||
if (!el) return;
|
||||
el.style.setProperty('--grid-column-count', String(meta.columnCount));
|
||||
el.style.setProperty('--grid-item-height', `${meta.itemHeight}px`);
|
||||
el.style.setProperty('--grid-row-count', String(meta.rowCount));
|
||||
setTableMetaVersion((v) => v + 1);
|
||||
}
|
||||
});
|
||||
}, [containerWidth, resolvedItemCount, throttledSetTableMeta, containerRef]);
|
||||
}, [containerWidth, resolvedItemCount, throttledSetTableMeta]);
|
||||
|
||||
const controls = useDefaultItemListControls({
|
||||
enableMultiSelect,
|
||||
|
||||
@@ -1214,7 +1214,7 @@ export const AlbumArtistDetailContent = ({
|
||||
artistSongsLink={artistSongsLink}
|
||||
onArtistRadio={handleArtistRadio}
|
||||
/>
|
||||
<Grid gutter="2xl">
|
||||
<Grid gap="2xl">
|
||||
<AlbumArtistMetadataGenres
|
||||
genres={detailQuery.data?.genres}
|
||||
order={genresOrder}
|
||||
|
||||
@@ -273,7 +273,7 @@ export const SleepTimerButton = () => {
|
||||
|
||||
<Divider my="md" />
|
||||
|
||||
<Grid gutter="xs">
|
||||
<Grid gap="xs">
|
||||
{PRESET_OPTIONS.filter((option) => option.mode === 'timed').map(
|
||||
(option, index) => (
|
||||
<Grid.Col key={index} span={4}>
|
||||
|
||||
@@ -552,7 +552,7 @@ const PlaylistTableItem = memo(
|
||||
|
||||
return (
|
||||
<Box className={styles.container} w="100%">
|
||||
<Grid align="center" gutter="xs" w="100%">
|
||||
<Grid align="center" gap="xs" w="100%">
|
||||
<Grid.Col span="content">
|
||||
<Flex align="center" justify="center" px="sm">
|
||||
<ItemImage
|
||||
|
||||
@@ -18,12 +18,7 @@ export const ActionBar = () => {
|
||||
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<Grid
|
||||
display="flex"
|
||||
gutter="sm"
|
||||
style={{ padding: '0 var(--theme-spacing-md)' }}
|
||||
w="100%"
|
||||
>
|
||||
<Grid display="flex" gap="sm" style={{ padding: '0 var(--theme-spacing-md)' }} w="100%">
|
||||
<Grid.Col span={7}>
|
||||
<TextInput
|
||||
leftSection={<Icon icon="search" />}
|
||||
|
||||
@@ -6,7 +6,7 @@ import styles from './sidebar-item.module.css';
|
||||
|
||||
import { Button, ButtonProps } from '/@/shared/components/button/button';
|
||||
|
||||
interface SidebarItemProps extends ButtonProps {
|
||||
interface SidebarItemProps extends Omit<ButtonProps, 'component' | 'ref'> {
|
||||
to: LinkProps['to'];
|
||||
}
|
||||
|
||||
|
||||
@@ -28,4 +28,4 @@ const BaseBadge = ({ children, classNames, variant = 'default', ...props }: Badg
|
||||
);
|
||||
};
|
||||
|
||||
export const Badge = createPolymorphicComponent<'button', BadgeProps>(BaseBadge);
|
||||
export const Badge = createPolymorphicComponent<'div', BadgeProps>(BaseBadge);
|
||||
|
||||
Reference in New Issue
Block a user