rename list components

This commit is contained in:
jeffvli
2025-09-29 17:42:57 -07:00
parent 8dcc28376c
commit 0a591a3f09
6 changed files with 13 additions and 16 deletions
@@ -15,17 +15,14 @@ import {
} from 'react'; } from 'react';
import { List, ListImperativeAPI, RowComponentProps, useListRef } from 'react-window-v2'; import { List, ListImperativeAPI, RowComponentProps, useListRef } from 'react-window-v2';
import styles from './item-list-detail.module.css'; import styles from './item-detail-list.module.css';
import { ItemDetail } from '/@/renderer/components/item-detail/item-detail'; import { ItemDetail } from '/@/renderer/components/item-detail/item-detail';
import { ExpandedListItem } from '/@/renderer/components/item-list/expanded-list-item'; import { ExpandedListItem } from '/@/renderer/components/item-list/expanded-list-item';
import { import { useItemListState } from '/@/renderer/components/item-list/helpers/item-list-state';
ItemListStateActions,
useItemListState,
} from '/@/renderer/components/item-list/helpers/item-list-state';
import { LibraryItem } from '/@/shared/types/domain-types'; import { LibraryItem } from '/@/shared/types/domain-types';
export interface ItemGridProps { export interface ItemDetailListProps {
data: unknown[]; data: unknown[];
enableExpansion?: boolean; enableExpansion?: boolean;
enableSelection?: boolean; enableSelection?: boolean;
@@ -64,7 +61,7 @@ const expandedAnimationVariants: Variants = {
}, },
}; };
export const ItemListDetail = ({ export const ItemDetailList = ({
data, data,
enableExpansion = false, enableExpansion = false,
enableSelection = false, enableSelection = false,
@@ -79,7 +76,7 @@ export const ItemListDetail = ({
onScrollEnd, onScrollEnd,
onStartReached, onStartReached,
totalItemCount = 0, totalItemCount = 0,
}: ItemGridProps) => { }: ItemDetailListProps) => {
const itemDetailRef = useListRef(null); const itemDetailRef = useListRef(null);
const scrollContainerRef = useRef<HTMLDivElement | null>(null); const scrollContainerRef = useRef<HTMLDivElement | null>(null);
const { ref: containerRef, width: containerWidth } = useElementSize(); const { ref: containerRef, width: containerWidth } = useElementSize();
@@ -16,7 +16,7 @@ import {
} from 'react'; } from 'react';
import { List, ListImperativeAPI, RowComponentProps, useListRef } from 'react-window-v2'; import { List, ListImperativeAPI, RowComponentProps, useListRef } from 'react-window-v2';
import styles from './item-grid.module.css'; import styles from './item-grid-list.module.css';
import { getDataRowsCount, ItemCard } from '/@/renderer/components/item-card/item-card'; import { getDataRowsCount, ItemCard } from '/@/renderer/components/item-card/item-card';
import { ExpandedListItem } from '/@/renderer/components/item-list/expanded-list-item'; import { ExpandedListItem } from '/@/renderer/components/item-list/expanded-list-item';
@@ -26,7 +26,7 @@ import {
} from '/@/renderer/components/item-list/helpers/item-list-state'; } from '/@/renderer/components/item-list/helpers/item-list-state';
import { LibraryItem } from '/@/shared/types/domain-types'; import { LibraryItem } from '/@/shared/types/domain-types';
export interface ItemGridProps { export interface ItemGridListProps {
data: unknown[]; data: unknown[];
enableExpansion?: boolean; enableExpansion?: boolean;
enableSelection?: boolean; enableSelection?: boolean;
@@ -75,7 +75,7 @@ const expandedAnimationVariants: Variants = {
}, },
}; };
export const ItemGrid = ({ export const ItemGridList = ({
data, data,
enableExpansion = false, enableExpansion = false,
enableSelection = false, enableSelection = false,
@@ -90,7 +90,7 @@ export const ItemGrid = ({
onScrollEnd, onScrollEnd,
onStartReached, onStartReached,
totalItemCount = 0, totalItemCount = 0,
}: ItemGridProps) => { }: ItemGridListProps) => {
const itemGridRef = useListRef(null); const itemGridRef = useListRef(null);
const scrollContainerRef = useRef<HTMLDivElement | null>(null); const scrollContainerRef = useRef<HTMLDivElement | null>(null);
const { ref: containerRef, width: containerWidth } = useElementSize(); const { ref: containerRef, width: containerWidth } = useElementSize();
@@ -6,7 +6,7 @@ import {
InfiniteListProps, InfiniteListProps,
useItemListInfiniteLoader, useItemListInfiniteLoader,
} from '/@/renderer/components/item-list/helpers/item-list-infinite-loader'; } from '/@/renderer/components/item-list/helpers/item-list-infinite-loader';
import { ItemGrid } from '/@/renderer/components/item-list/item-grid/item-grid'; import { ItemGridList } from '/@/renderer/components/item-list/item-grid-list/item-grid-list';
import { albumQueries } from '/@/renderer/features/albums/api/album-api'; import { albumQueries } from '/@/renderer/features/albums/api/album-api';
import { import {
AlbumListQuery, AlbumListQuery,
@@ -44,7 +44,7 @@ export const AlbumListInfiniteGrid = forwardRef<any, AlbumListInfiniteGridProps>
}); });
return ( return (
<ItemGrid <ItemGridList
data={data || []} data={data || []}
itemType={LibraryItem.ALBUM} itemType={LibraryItem.ALBUM}
onRangeChanged={onRangeChanged} onRangeChanged={onRangeChanged}
@@ -6,7 +6,7 @@ import {
PaginatedListProps, PaginatedListProps,
useItemListPaginatedLoader, useItemListPaginatedLoader,
} from '/@/renderer/components/item-list/helpers/item-list-paginated-loader'; } from '/@/renderer/components/item-list/helpers/item-list-paginated-loader';
import { ItemGrid } from '/@/renderer/components/item-list/item-grid/item-grid'; import { ItemGridList } from '/@/renderer/components/item-list/item-grid-list/item-grid-list';
import { ItemListWithPagination } from '/@/renderer/components/item-list/item-list-pagination/item-list-pagination'; import { ItemListWithPagination } from '/@/renderer/components/item-list/item-list-pagination/item-list-pagination';
import { useItemListPagination } from '/@/renderer/components/item-list/item-list-pagination/use-item-list-pagination'; import { useItemListPagination } from '/@/renderer/components/item-list/item-list-pagination/use-item-list-pagination';
import { albumQueries } from '/@/renderer/features/albums/api/album-api'; import { albumQueries } from '/@/renderer/features/albums/api/album-api';
@@ -58,7 +58,7 @@ export const AlbumListPaginatedGrid = forwardRef<any, AlbumListPaginatedGridProp
pageCount={pageCount} pageCount={pageCount}
totalItemCount={totalItemCount} totalItemCount={totalItemCount}
> >
<ItemGrid data={data || []} itemType={LibraryItem.ALBUM} ref={ref} /> <ItemGridList data={data || []} itemType={LibraryItem.ALBUM} ref={ref} />
</ItemListWithPagination> </ItemListWithPagination>
); );
}, },