mirror of
https://github.com/DerTyp7/apartment-altenau-nextjs.git
synced 2025-10-30 13:17:12 +01:00
[init] initlialize next app & convert old react app
This commit is contained in:
35
components/GalleryGrid.jsx
Normal file
35
components/GalleryGrid.jsx
Normal file
@@ -0,0 +1,35 @@
|
||||
/* eslint-disable @next/next/no-img-element */
|
||||
import { useEffect, useState } from "react";
|
||||
import styles from "../styles/GalleryGrid.module.scss";
|
||||
import { useRouter } from "next/router";
|
||||
|
||||
function GalleryGrid({ images, baseURL }) {
|
||||
const router = useRouter();
|
||||
const locale = router.locale;
|
||||
|
||||
return (
|
||||
<div className={styles.galleryGrid}>
|
||||
<div className={styles.galleryGridGrid}>
|
||||
{images.length > 0
|
||||
? images.map((image, i) => (
|
||||
<div
|
||||
key={i}
|
||||
onClick={() => router.push({ search: "activeImg=" + image.id })}
|
||||
className="noSelect"
|
||||
>
|
||||
<img
|
||||
src={image.url}
|
||||
alt={locale === "en" ? image.title.en : image.title.de}
|
||||
/>
|
||||
<div className={styles.galleryImageTitle}>
|
||||
<p>{locale === "en" ? image.title.en : image.title.de}</p>
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
: ""}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default GalleryGrid;
|
||||
Reference in New Issue
Block a user