Improve manga grid/list rendering
This commit is contained in:
@@ -19,6 +19,8 @@ interface LibraryMangaGridProps
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
const loadMoreNoop = () => undefined;
|
||||
|
||||
export const LibraryMangaGrid: React.FC<LibraryMangaGridProps> = ({
|
||||
showFilteredOutMessage,
|
||||
message,
|
||||
@@ -41,7 +43,7 @@ export const LibraryMangaGrid: React.FC<LibraryMangaGridProps> = ({
|
||||
gridWrapperProps={{ sx: { p: 1 } }}
|
||||
{...gridProps}
|
||||
hasNextPage={false}
|
||||
loadMore={() => undefined}
|
||||
loadMore={loadMoreNoop}
|
||||
message={showFilteredOutMessage ? t('library.error.label.no_matches') : message}
|
||||
messageExtra={showFilteredOutMessage ? undefined : messageExtra}
|
||||
gridLayout={options.gridLayout}
|
||||
|
||||
@@ -122,10 +122,13 @@ export function Library() {
|
||||
currentKey: activeTab?.id.toString(),
|
||||
});
|
||||
|
||||
const handleSelect: typeof handleSelection = (id, selected, selectOptions) => {
|
||||
setIsSelectModeActive(!!(selectedItemIds.length + (selected ? 1 : -1)));
|
||||
handleSelection(id, selected, selectOptions);
|
||||
};
|
||||
const handleSelect: typeof handleSelection = useCallback(
|
||||
(id, selected, selectOptions) => {
|
||||
setIsSelectModeActive(!!(selectedItemIds.length + (selected ? 1 : -1)));
|
||||
handleSelection(id, selected, selectOptions);
|
||||
},
|
||||
[setIsSelectModeActive, handleSelection],
|
||||
);
|
||||
|
||||
const selectedMangas = useMemo(
|
||||
() =>
|
||||
@@ -212,7 +215,6 @@ export function Library() {
|
||||
isSelectModeActive,
|
||||
areNoItemsSelected,
|
||||
areAllItemsSelected,
|
||||
selectedItemIds.length,
|
||||
mangas.length,
|
||||
activeTab,
|
||||
showTabSize,
|
||||
|
||||
Reference in New Issue
Block a user