mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-03 19:21:39 +00:00
Add grid view for tracks (#128)
This commit is contained in:
parent
d3503af12c
commit
0b62bee3a6
9 changed files with 429 additions and 30 deletions
|
|
@ -4,6 +4,7 @@ import { Spinner } from '/@/renderer/components';
|
|||
import { useListContext } from '/@/renderer/context/list-context';
|
||||
import { useListStoreByKey } from '/@/renderer/store';
|
||||
import { ListDisplayType } from '/@/renderer/types';
|
||||
import { VirtualInfiniteGridRef } from '/@/renderer/components/virtual-grid';
|
||||
|
||||
const SongListTableView = lazy(() =>
|
||||
import('/@/renderer/features/songs/components/song-list-table-view').then((module) => ({
|
||||
|
|
@ -11,12 +12,19 @@ const SongListTableView = lazy(() =>
|
|||
})),
|
||||
);
|
||||
|
||||
const SongListGridView = lazy(() =>
|
||||
import('/@/renderer/features/songs/components/song-list-grid-view').then((module) => ({
|
||||
default: module.SongListGridView,
|
||||
})),
|
||||
);
|
||||
|
||||
interface SongListContentProps {
|
||||
gridRef: MutableRefObject<VirtualInfiniteGridRef | null>;
|
||||
itemCount?: number;
|
||||
tableRef: MutableRefObject<AgGridReactType | null>;
|
||||
}
|
||||
|
||||
export const SongListContent = ({ itemCount, tableRef }: SongListContentProps) => {
|
||||
export const SongListContent = ({ itemCount, gridRef, tableRef }: SongListContentProps) => {
|
||||
const { pageKey } = useListContext();
|
||||
const { display } = useListStoreByKey({ key: pageKey });
|
||||
|
||||
|
|
@ -25,7 +33,10 @@ export const SongListContent = ({ itemCount, tableRef }: SongListContentProps) =
|
|||
return (
|
||||
<Suspense fallback={<Spinner container />}>
|
||||
{isGrid ? (
|
||||
<></>
|
||||
<SongListGridView
|
||||
gridRef={gridRef}
|
||||
itemCount={itemCount}
|
||||
/>
|
||||
) : (
|
||||
<SongListTableView
|
||||
itemCount={itemCount}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue