feat: add shared collection page

This commit is contained in:
Sonny
2024-06-02 18:35:10 +02:00
committed by Sonny
parent dc54a1197d
commit 8a4f895853
15 changed files with 93 additions and 18 deletions

View File

@@ -109,7 +109,6 @@ function DashboardPage(props: Readonly<DashboardPageProps>) {
}
}, [isMobile, isTablet, closeCollectionList, closeNavigation]);
console.log(isMobile, isTablet, isNavigationOpen, isCollectionListOpen);
return (
<DashboardProviders
collections={props.collections}

24
inertia/pages/shared.tsx Normal file
View File

@@ -0,0 +1,24 @@
import { ReactNode } from 'react';
import CollectionHeader from '~/components/dashboard/collection/header/collection_header';
import LinkList from '~/components/dashboard/link/link_list';
import ContentLayout from '~/components/layouts/content_layout';
import { ActiveCollectionContext } from '~/contexts/active_collection_context';
import { CollectionWithLinks } from '~/types/app';
const SharedCollectionPage = ({
collection,
}: {
collection: CollectionWithLinks;
}) => (
<ActiveCollectionContext.Provider
value={{ activeCollection: collection, setActiveCollection: () => {} }}
>
<CollectionHeader showButtons={false} showControls={false} />
<LinkList links={collection.links} showControls={false} />
</ActiveCollectionContext.Provider>
);
SharedCollectionPage.layout = (page: ReactNode) => (
<ContentLayout css={{ width: '900px' }} children={page} />
);
export default SharedCollectionPage;