Skip to content

Commit

Permalink
remove info drawer
Browse files Browse the repository at this point in the history
  • Loading branch information
malmz committed May 16, 2024
1 parent 57f49a5 commit 77c4475
Showing 1 changed file with 0 additions and 51 deletions.
51 changes: 0 additions & 51 deletions app/routes/_main.album.$id.$imageId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,12 @@ import {
CarouselNext,
CarouselPrevious,
} from '~/components/ui/carousel';
import {
Drawer,
DrawerContent,
DrawerHeader,
DrawerTitle,
DrawerTrigger,
} from '~/components/ui/drawer';
import { getImage } from '~/lib/data.server';
import type { AlbumLoader } from './_main.album.$id';

export async function loader({ params }: LoaderFunctionArgs) {
const albumId = Number(params.id);
const imageId = Number(params.imageId);
//const album = getAlbum(albumId);
const image = await getImage(imageId);
if (!image) throw new Response('Not found', { status: 404 });
return {
Expand All @@ -42,48 +34,6 @@ export async function loader({ params }: LoaderFunctionArgs) {
};
}

function InfoDrawer({
image,
}: {
image: {
taken_by_name: string | null;
taken_at: Date;
mimetype: string | null;
exif_data: any | null;
};
}) {
return (
<>
<Drawer>
<DrawerTrigger asChild>
<Button variant='outline' size='sm' className='sm:hidden'>
Image info
</Button>
</DrawerTrigger>
<DrawerContent>
<DrawerHeader>
<DrawerTitle>Info</DrawerTitle>
</DrawerHeader>
<div className='mx-auto grid max-w-md grid-cols-2 gap-2 p-4 py-8 text-sm'>
<span>Fotograf</span>
<span>{image.taken_by_name}</span>
<span>Tagen vid</span>
<span>{format(image.taken_at, 'PPP, pp', { locale: sv })}</span>
<span>Format</span>
<span>{image.mimetype}</span>
<span>Märke</span>
<span>{image.exif_data?.Image?.Make}</span>
<span>Model</span>
<span>{image.exif_data?.Image?.Model}</span>
<span>Lins</span>
<span>{image.exif_data?.Photo?.LensModel}</span>
</div>
</DrawerContent>
</Drawer>
</>
);
}

function ImageCarousel({
albumId,
imageId,
Expand Down Expand Up @@ -182,7 +132,6 @@ export default function Page() {
<span>{albumName}</span>
</Link>
</Button>
{/* <InfoDrawer image={image}></InfoDrawer> */}
</div>
<div className='mx-auto my-2 max-w-screen-lg px-8'>
<img
Expand Down

0 comments on commit 77c4475

Please sign in to comment.