parent
f39059202f
commit
ac318177d4
@ -1,6 +1,7 @@
|
||||
import type { Options } from "node_modules/payload/dist/globals/operations/local/findOne";
|
||||
import { getPayload } from "@/utils/payload";
|
||||
|
||||
export const getAbout = async () => {
|
||||
export const getAbout = async (opts: Omit<Options<"about">, "slug"> = {}) => {
|
||||
const payload = await getPayload();
|
||||
return await payload.findGlobal({ slug: "about" });
|
||||
return await payload.findGlobal({ slug: "about", ...opts });
|
||||
};
|
||||
|
@ -1,6 +1,7 @@
|
||||
import type { Options } from "node_modules/payload/dist/globals/operations/local/findOne";
|
||||
import { getPayload } from "@/utils/payload";
|
||||
|
||||
export const getContact = async () => {
|
||||
export const getContact = async (opts: Omit<Options<"contact">, "slug"> = {}) => {
|
||||
const payload = await getPayload();
|
||||
return await payload.findGlobal({ slug: "contact" });
|
||||
return await payload.findGlobal({ slug: "contact", ...opts });
|
||||
};
|
||||
|
@ -1,6 +1,7 @@
|
||||
import type { Options } from "node_modules/payload/dist/globals/operations/local/findOne";
|
||||
import { getPayload } from "@/utils/payload";
|
||||
|
||||
export const getGallery = async () => {
|
||||
export const getGallery = async (opts: Omit<Options<"gallery">, "slug"> = {}) => {
|
||||
const payload = await getPayload();
|
||||
return await payload.findGlobal({ slug: "gallery" });
|
||||
return await payload.findGlobal({ slug: "gallery", ...opts });
|
||||
};
|
||||
|
@ -1,6 +1,7 @@
|
||||
import type { Options } from "node_modules/payload/dist/globals/operations/local/findOne";
|
||||
import { getPayload } from "@/utils/payload";
|
||||
|
||||
export const getHome = async () => {
|
||||
export const getHome = async (opts: Omit<Options<"home">, "slug"> = {}) => {
|
||||
const payload = await getPayload();
|
||||
return await payload.findGlobal({ slug: "home" });
|
||||
return await payload.findGlobal({ slug: "home", ...opts });
|
||||
};
|
||||
|
@ -1,6 +1,14 @@
|
||||
import type { Options } from "node_modules/payload/dist/collections/operations/local/find";
|
||||
import { getPayload } from "@/utils/payload";
|
||||
|
||||
export const getOpeningTimes = async () => {
|
||||
export const getOpeningTimes = async (
|
||||
opts: Omit<Options<"opening-time">, "collection" | "sort" | "pagination">,
|
||||
) => {
|
||||
const payload = await getPayload();
|
||||
return await payload.find({ collection: "opening-time", sort: "from", pagination: false });
|
||||
return await payload.find({
|
||||
collection: "opening-time",
|
||||
sort: "from",
|
||||
pagination: false,
|
||||
...opts,
|
||||
});
|
||||
};
|
||||
|
@ -1,9 +1,10 @@
|
||||
import Carousel from "@/components/ui/carousel";
|
||||
import { Locale } from "@/i18n/settings";
|
||||
import { Media } from "@/payload-types";
|
||||
import { getGallery } from "@/api";
|
||||
|
||||
export default async function Gallery() {
|
||||
const { images } = await getGallery();
|
||||
export default async function Gallery({ locale }: { locale: Locale }) {
|
||||
const { images } = await getGallery({ locale });
|
||||
|
||||
return <Carousel images={images.map(({ image }) => image as Media)} w="100%" />;
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
import { locales } from "@/i18n/settings";
|
||||
import { Locale } from "@/i18n/settings";
|
||||
|
||||
export type Params = { locale: (typeof locales)[number] };
|
||||
export type Params = { locale: Locale };
|
||||
|
@ -0,0 +1,6 @@
|
||||
export const ContactEmbedNotice = () => (
|
||||
<p>
|
||||
Use a generator like <a href="https://www.maps.ie/create-google-map/">maps.ie</a> to create a
|
||||
Google Maps embed.
|
||||
</p>
|
||||
);
|
@ -1,2 +1,4 @@
|
||||
export const defaultLocale = "de" as const;
|
||||
export const locales = [defaultLocale, "en"] as const;
|
||||
|
||||
export type Locale = (typeof locales)[number];
|
||||
|
Loading…
Reference in New Issue