mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-15 13:00:25 +02:00
handle table row index values on paginated lists
This commit is contained in:
@@ -74,6 +74,8 @@ export const AlbumListPaginatedTable = forwardRef<any, AlbumListPaginatedTablePr
|
||||
itemListKey: ItemListKey.ALBUM,
|
||||
});
|
||||
|
||||
const startRowIndex = currentPage * itemsPerPage;
|
||||
|
||||
return (
|
||||
<ItemListWithPagination
|
||||
currentPage={currentPage}
|
||||
@@ -86,7 +88,6 @@ export const AlbumListPaginatedTable = forwardRef<any, AlbumListPaginatedTablePr
|
||||
autoFitColumns={autoFitColumns}
|
||||
CellComponent={ItemTableListColumn}
|
||||
columns={columns}
|
||||
currentPage={currentPage}
|
||||
data={data || []}
|
||||
enableAlternateRowColors={enableAlternateRowColors}
|
||||
enableHorizontalBorders={enableHorizontalBorders}
|
||||
@@ -103,6 +104,7 @@ export const AlbumListPaginatedTable = forwardRef<any, AlbumListPaginatedTablePr
|
||||
onScrollEnd={handleOnScrollEnd}
|
||||
ref={ref}
|
||||
size={size}
|
||||
startRowIndex={startRowIndex}
|
||||
/>
|
||||
</ItemListWithPagination>
|
||||
);
|
||||
|
||||
@@ -75,6 +75,8 @@ export const AlbumArtistListPaginatedTable = forwardRef<any, AlbumArtistListPagi
|
||||
itemListKey: ItemListKey.ALBUM_ARTIST,
|
||||
});
|
||||
|
||||
const startRowIndex = currentPage * itemsPerPage;
|
||||
|
||||
return (
|
||||
<ItemListWithPagination
|
||||
currentPage={currentPage}
|
||||
@@ -87,7 +89,6 @@ export const AlbumArtistListPaginatedTable = forwardRef<any, AlbumArtistListPagi
|
||||
autoFitColumns={autoFitColumns}
|
||||
CellComponent={ItemTableListColumn}
|
||||
columns={columns}
|
||||
currentPage={currentPage}
|
||||
data={data || []}
|
||||
enableAlternateRowColors={enableAlternateRowColors}
|
||||
enableExpansion={false}
|
||||
@@ -105,6 +106,7 @@ export const AlbumArtistListPaginatedTable = forwardRef<any, AlbumArtistListPagi
|
||||
onScrollEnd={handleOnScrollEnd}
|
||||
ref={ref}
|
||||
size={size}
|
||||
startRowIndex={startRowIndex}
|
||||
/>
|
||||
</ItemListWithPagination>
|
||||
);
|
||||
|
||||
@@ -6,10 +6,10 @@ import { useItemListPaginatedLoader } from '/@/renderer/components/item-list/hel
|
||||
import { useItemListColumnReorder } from '/@/renderer/components/item-list/helpers/use-item-list-column-reorder';
|
||||
import { useItemListColumnResize } from '/@/renderer/components/item-list/helpers/use-item-list-column-resize';
|
||||
import { useItemListScrollPersist } from '/@/renderer/components/item-list/helpers/use-item-list-scroll-persist';
|
||||
import { ItemTableList } from '/@/renderer/components/item-list/item-table-list/item-table-list';
|
||||
import { ItemTableListColumn } from '/@/renderer/components/item-list/item-table-list/item-table-list-column';
|
||||
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 { ItemTableList } from '/@/renderer/components/item-list/item-table-list/item-table-list';
|
||||
import { ItemTableListColumn } from '/@/renderer/components/item-list/item-table-list/item-table-list-column';
|
||||
import { ItemListTableComponentProps } from '/@/renderer/components/item-list/types';
|
||||
import { artistsQueries } from '/@/renderer/features/artists/api/artists-api';
|
||||
import {
|
||||
@@ -74,6 +74,8 @@ export const ArtistListPaginatedTable = forwardRef<any, ArtistListPaginatedTable
|
||||
itemListKey: ItemListKey.ARTIST,
|
||||
});
|
||||
|
||||
const startRowIndex = currentPage * itemsPerPage;
|
||||
|
||||
return (
|
||||
<ItemListWithPagination
|
||||
currentPage={currentPage}
|
||||
@@ -86,7 +88,6 @@ export const ArtistListPaginatedTable = forwardRef<any, ArtistListPaginatedTable
|
||||
autoFitColumns={autoFitColumns}
|
||||
CellComponent={ItemTableListColumn}
|
||||
columns={columns}
|
||||
currentPage={currentPage}
|
||||
data={data || []}
|
||||
enableAlternateRowColors={enableAlternateRowColors}
|
||||
enableExpansion={false}
|
||||
@@ -104,6 +105,7 @@ export const ArtistListPaginatedTable = forwardRef<any, ArtistListPaginatedTable
|
||||
onScrollEnd={handleOnScrollEnd}
|
||||
ref={ref}
|
||||
size={size}
|
||||
startRowIndex={startRowIndex}
|
||||
/>
|
||||
</ItemListWithPagination>
|
||||
);
|
||||
|
||||
@@ -74,6 +74,8 @@ export const GenreListPaginatedTable = forwardRef<any, GenreListPaginatedTablePr
|
||||
itemListKey: ItemListKey.GENRE,
|
||||
});
|
||||
|
||||
const startRowIndex = currentPage * itemsPerPage;
|
||||
|
||||
return (
|
||||
<ItemListWithPagination
|
||||
currentPage={currentPage}
|
||||
@@ -86,7 +88,6 @@ export const GenreListPaginatedTable = forwardRef<any, GenreListPaginatedTablePr
|
||||
autoFitColumns={autoFitColumns}
|
||||
CellComponent={ItemTableListColumn}
|
||||
columns={columns}
|
||||
currentPage={currentPage}
|
||||
data={data || []}
|
||||
enableAlternateRowColors={enableAlternateRowColors}
|
||||
enableExpansion={false}
|
||||
@@ -104,6 +105,7 @@ export const GenreListPaginatedTable = forwardRef<any, GenreListPaginatedTablePr
|
||||
onScrollEnd={handleOnScrollEnd}
|
||||
ref={ref}
|
||||
size={size}
|
||||
startRowIndex={startRowIndex}
|
||||
/>
|
||||
</ItemListWithPagination>
|
||||
);
|
||||
|
||||
@@ -74,6 +74,8 @@ export const PlaylistListPaginatedTable = forwardRef<any, PlaylistListPaginatedT
|
||||
itemListKey: ItemListKey.PLAYLIST,
|
||||
});
|
||||
|
||||
const startRowIndex = currentPage * itemsPerPage;
|
||||
|
||||
return (
|
||||
<ItemListWithPagination
|
||||
currentPage={currentPage}
|
||||
@@ -86,7 +88,6 @@ export const PlaylistListPaginatedTable = forwardRef<any, PlaylistListPaginatedT
|
||||
autoFitColumns={autoFitColumns}
|
||||
CellComponent={ItemTableListColumn}
|
||||
columns={columns}
|
||||
currentPage={currentPage}
|
||||
data={data || []}
|
||||
enableAlternateRowColors={enableAlternateRowColors}
|
||||
enableHorizontalBorders={enableHorizontalBorders}
|
||||
@@ -103,6 +104,7 @@ export const PlaylistListPaginatedTable = forwardRef<any, PlaylistListPaginatedT
|
||||
onScrollEnd={handleOnScrollEnd}
|
||||
ref={ref}
|
||||
size={size}
|
||||
startRowIndex={startRowIndex}
|
||||
/>
|
||||
</ItemListWithPagination>
|
||||
);
|
||||
|
||||
@@ -69,6 +69,8 @@ export const SongListPaginatedTable = forwardRef<any, SongListPaginatedTableProp
|
||||
itemListKey: ItemListKey.SONG,
|
||||
});
|
||||
|
||||
const startRowIndex = currentPage * itemsPerPage;
|
||||
|
||||
return (
|
||||
<ItemListWithPagination
|
||||
currentPage={currentPage}
|
||||
@@ -81,7 +83,6 @@ export const SongListPaginatedTable = forwardRef<any, SongListPaginatedTableProp
|
||||
autoFitColumns={autoFitColumns}
|
||||
CellComponent={ItemTableListColumn}
|
||||
columns={columns}
|
||||
currentPage={currentPage}
|
||||
data={data || []}
|
||||
enableAlternateRowColors={enableAlternateRowColors}
|
||||
enableExpansion={false}
|
||||
@@ -99,6 +100,7 @@ export const SongListPaginatedTable = forwardRef<any, SongListPaginatedTableProp
|
||||
onScrollEnd={handleOnScrollEnd}
|
||||
ref={ref}
|
||||
size={size}
|
||||
startRowIndex={startRowIndex}
|
||||
/>
|
||||
</ItemListWithPagination>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user