-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added gallery details & fixed window content width problems
- Loading branch information
Showing
8 changed files
with
132 additions
and
32 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
106 changes: 106 additions & 0 deletions
106
app/(desktop)/[lng]/@pictures/(.)/pictures/gallery/[slug]/page.tsx
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,106 @@ | ||
import BlogHeader from "@/components/blog/blog-header"; | ||
import { getImageSource } from "@/components/contentful/image-asset"; | ||
import { WindowTitle } from "@/components/os/windowManager"; | ||
import PhotoGallery, { GalleryPhoto } from "@/components/photo-gallery"; | ||
import Translate from "@/components/translate"; | ||
import PageBaseConfiguration from "@/configuration"; | ||
import { GetGalleryBySlug } from "@/contentful/provider/gallery-provider"; | ||
import { Metadata } from "next"; | ||
import Link from "next/link"; | ||
import { notFound } from "next/navigation"; | ||
|
||
export async function generateMetadata({ | ||
params, | ||
}: { | ||
params: { slug: string; lng: string }; | ||
}): Promise<Metadata> { | ||
const config = PageBaseConfiguration(); | ||
const gallery = await GetGalleryBySlug(params.slug, params.lng); | ||
|
||
if (!gallery) { | ||
return notFound(); | ||
} | ||
|
||
return { | ||
metadataBase: config.baseUrl, | ||
title: `${gallery.name} `, | ||
description: gallery.description, | ||
openGraph: { | ||
type: "article", | ||
|
||
publishedTime: gallery.date.toISOString(), | ||
url: `${config.baseUrl}/${params.lng}/pictures/gallery/${params.slug}`, | ||
locale: params.lng, | ||
images: [ | ||
{ url: getImageSource(gallery.teaserImage, 800), width: 800 }, | ||
{ url: getImageSource(gallery.teaserImage, 1800), width: 1800 }, | ||
], | ||
}, | ||
}; | ||
} | ||
|
||
export default async function GalleryOverlay({ | ||
params, | ||
}: { | ||
params: { slug: string; lng: string }; | ||
}) { | ||
const gallery = await GetGalleryBySlug(params.slug, params.lng); | ||
|
||
if (!gallery) { | ||
return notFound(); | ||
} | ||
|
||
|
||
let galleryImages: GalleryPhoto[] = []; | ||
|
||
gallery.images.map((image: any) => { | ||
galleryImages.push({ | ||
src: getImageSource(image, 400), | ||
lightboxImageSrc: getImageSource(image, 1200), | ||
alt: image.fields.description, | ||
title: image.fields.title, | ||
width: image.fields.file.details.image.width, | ||
height: image.fields.file.details.image.height, | ||
}); | ||
}); | ||
|
||
return ( | ||
<div className="flex w-full flex-col p-2"> | ||
<WindowTitle id="pictures" title={`${gallery.name}`} /> | ||
<BlogHeader title={gallery.name} backgroundImage={gallery.teaserImage} /> | ||
|
||
<div className="mt-2 w-full rounded-md bg-white p-4 dark:bg-neutral-800"> | ||
<PhotoGallery photos={galleryImages} /> | ||
</div> | ||
|
||
<div className="mr-1 mt-2 flex flex-nowrap text-neutral-800"> | ||
<Link | ||
href={`/${params.lng}/pictures`} | ||
className="rounded bg-sky-400 px-4 py-2 font-semibold text-white transition hover:bg-sky-700 dark:bg-sky-600 dark:hover:bg-sky-700" | ||
> | ||
<div className="flex flex-nowrap"> | ||
<div> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
strokeWidth={1.5} | ||
stroke="currentColor" | ||
className="h-6 w-6 pr-2" | ||
> | ||
<path | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
d="M9 15L3 9m0 0l6-6M3 9h12a6 6 0 010 12h-3" | ||
/> | ||
</svg> | ||
</div> | ||
<div> | ||
<Translate id="back" ns="blog" locale={params.lng} /> | ||
</div> | ||
</div> | ||
</Link> | ||
</div> | ||
</div> | ||
); | ||
} |
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
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
dd43423
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
patrick-arns-de – ./
patrick-arns-de.vercel.app
patrick-arns-de-arns.vercel.app
dev.patrick-arns.de
patrick-arns.de
www.patrick-arns.de
patrick-arns-de-git-master-arns.vercel.app