Skip to content

Commit

Permalink
feature(web): Clicking an image in the preview modal will open it in …
Browse files Browse the repository at this point in the history
…a new tab (#159)
  • Loading branch information
lilacpixel authored May 16, 2024
1 parent 747efa5 commit c0aa6d5
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions apps/web/components/dashboard/preview/AssetContentSection.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Image from "next/image";
import Link from "next/link";

import type { ZBookmark } from "@hoarder/shared/types/bookmarks";

Expand All @@ -11,12 +12,17 @@ export function AssetContentSection({ bookmark }: { bookmark: ZBookmark }) {
case "image": {
return (
<div className="relative h-full min-w-full">
<Image
alt="asset"
fill={true}
className="object-contain"
src={`/api/assets/${bookmark.content.assetId}`}
/>
<Link
href={`/api/assets/${bookmark.content.assetId}`}
target="_blank"
>
<Image
alt="asset"
fill={true}
className="object-contain"
src={`/api/assets/${bookmark.content.assetId}`}
/>
</Link>
</div>
);
}
Expand Down

0 comments on commit c0aa6d5

Please sign in to comment.