refactor(preview): restore in-place modal, keep crawlable links

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
nerandClaude Fable 5 committed 2026-08-07 16:48:11 +03:00
1 parent 70b825c2dc
commit 8b56268430
13 files changed
+64 -128

No files matched your search

-11
View File
@@ -1,11 +0,0 @@
import { FC } from 'react';
import PreviewModal from '../../preview';
interface Props {
params: { id: string };
}
const MovieModal: FC<Props> = ({ params: { id } }) => <PreviewModal showId={Number(id)} showType='movie' />;
export default MovieModal;
-11
View File
@@ -1,11 +0,0 @@
import { FC } from 'react';
import PreviewModal from '../../preview';
interface Props {
params: { id: string };
}
const SeriesModal: FC<Props> = ({ params: { id } }) => <PreviewModal showId={Number(id)} showType='tv' />;
export default SeriesModal;
-5
View File
@@ -1,5 +0,0 @@
// Matches every non-intercepted route so the preview modal unmounts
// when navigating elsewhere (e.g. to a person page from the credits).
const CatchAll = () => null;
export default CatchAll;
-3
View File
@@ -1,3 +0,0 @@
const Default = () => null;
export default Default;
-4
View File
@@ -1,4 +0,0 @@
// Matches the root route so the preview modal unmounts when navigating home.
const Empty = () => null;
export default Empty;
-29
View File
@@ -1,29 +0,0 @@
'use client';
import { FC } from 'react';
import { useAtomValue } from 'jotai';
import { useRouter } from 'next/navigation';
import Preview from '@/components/Preview';
import { previewSeedAtom } from '@/components/Preview/seed';
import { Modal } from '@/components/ui/dialog';
interface Props {
showId: Show['id'];
showType: Show['type'];
}
const PreviewModal: FC<Props> = ({ showId, showType }) => {
const router = useRouter();
const seed = useAtomValue(previewSeedAtom);
const show = seed?.id === showId && seed?.type === showType ? seed : undefined;
return (
<Modal className='block bg-background p-0 md:bg-black' onClose={() => router.back()}>
<Preview modal show={show} showId={showId} showType={showType} />
</Modal>
);
};
export default PreviewModal;
-10
View File
@@ -1,10 +0,0 @@
import { ReactNode } from 'react';
const SiteLayout = ({ children, modal }: { children: ReactNode; modal: ReactNode }) => (
<>
{children}
{modal}
</>
);
export default SiteLayout;