-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement photo grid layout and add react-plock for masonry effect
- Loading branch information
1 parent
45d03b0
commit 1089f4b
Showing
7 changed files
with
40 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"use client"; | ||
|
||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import { Masonry } from "react-plock"; | ||
import type { Photo } from "@/lib/getPhotography"; | ||
|
||
export const Grid = ({ photos }: { photos: Photo[] }) => { | ||
return ( | ||
<Masonry | ||
items={photos} | ||
config={{ | ||
columns: [1, 2], | ||
gap: [24, 24], | ||
media: [640, 1024], | ||
}} | ||
render={(result) => ( | ||
<Link key={`photo-${result.path}`} href={result.path} target="_blank"> | ||
<Image className="cursor-zoom-in rounded-lg bg-neutral-200 blur-0 duration-200 hover:opacity-70 dark:bg-neutral-200/15" src={result.path} alt={"Photo by Igor Kowalczyk"} width={720} height={480} sizes="(max-width: 640px) 100vw, (max-width: 1280px) 50vw, (max-width: 1536px) 33vw, 25vw" /> | ||
</Link> | ||
)} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.