mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-02 10:53:33 +00:00
Add initial album detail page
This commit is contained in:
parent
b2f9c73300
commit
1d82c84c9e
4 changed files with 514 additions and 0 deletions
40
src/renderer/features/albums/routes/album-detail-route.tsx
Normal file
40
src/renderer/features/albums/routes/album-detail-route.tsx
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { PageHeader, ScrollArea } from '/@/renderer/components';
|
||||
import { AnimatedPage } from '/@/renderer/features/shared';
|
||||
import { useRef } from 'react';
|
||||
import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact';
|
||||
import { useAlbumDetail } from '/@/renderer/features/albums/queries/album-detail-query';
|
||||
import { useParams } from 'react-router';
|
||||
import { useFastAverageColor } from '/@/renderer/hooks';
|
||||
import { AlbumDetailContent } from '/@/renderer/features/albums/components/album-detail-content';
|
||||
import { AlbumDetailHeader } from '/@/renderer/features/albums/components/album-detail-header';
|
||||
|
||||
const AlbumDetailRoute = () => {
|
||||
const tableRef = useRef<AgGridReactType | null>(null);
|
||||
const { albumId } = useParams() as { albumId: string };
|
||||
const detailQuery = useAlbumDetail({ id: albumId });
|
||||
const background = useFastAverageColor(detailQuery.data?.imageUrl);
|
||||
|
||||
return (
|
||||
<AnimatedPage>
|
||||
<PageHeader
|
||||
useOpacity
|
||||
position="absolute"
|
||||
/>
|
||||
|
||||
<ScrollArea
|
||||
h="100%"
|
||||
offsetScrollbars={false}
|
||||
styles={{
|
||||
scrollbar: {
|
||||
marginTop: '35px',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<AlbumDetailHeader background={background} />
|
||||
<AlbumDetailContent tableRef={tableRef} />
|
||||
</ScrollArea>
|
||||
</AnimatedPage>
|
||||
);
|
||||
};
|
||||
|
||||
export default AlbumDetailRoute;
|
||||
Loading…
Add table
Add a link
Reference in a new issue