Compare commits

..

3 Commits

4542
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -2,16 +2,19 @@
"name": "localbites-landing-page", "name": "localbites-landing-page",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"type": "module",
"scripts": { "scripts": {
"prepare": "panda codegen", "prepare": "panda codegen",
"dev": "next dev --turbo", "dev": "next dev --turbo",
"generate:importmap": "cross-env NODE_OPTIONS=--no-deprecation payload generate:importmap", "generate:importmap": "payload generate:importmap",
"generate:types": "cross-env NODE_OPTIONS=--no-deprecation payload generate:types", "generate:types": "payload generate:types",
"payload": "cross-env NODE_OPTIONS=--no-deprecation payload", "payload": "payload",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint", "lint": "next lint",
"format": "prettier --write \"./src/**/*.{js,jsx,ts,tsx}\"" "format": "prettier --write \"./src/**/*.{js,jsx,ts,tsx}\"",
"park-ui": "npx @park-ui/cli",
"components:add": "npx @park-ui/cli components add"
}, },
"dependencies": { "dependencies": {
"@ark-ui/react": "^3.9.0", "@ark-ui/react": "^3.9.0",
@ -21,7 +24,8 @@
"@payloadcms/translations": "^3.0.0-beta.94", "@payloadcms/translations": "^3.0.0-beta.94",
"graphql": "^16.9.0", "graphql": "^16.9.0",
"lucide-react": "^0.436.0", "lucide-react": "^0.436.0",
"next": "15.0.0-canary.132", "next": "^15.0.0-canary.134",
"next-international": "^1.2.4",
"payload": "^3.0.0-beta.94", "payload": "^3.0.0-beta.94",
"react": "19.0.0-rc-eb3ad065-20240822", "react": "19.0.0-rc-eb3ad065-20240822",
"react-dom": "19.0.0-rc-eb3ad065-20240822", "react-dom": "19.0.0-rc-eb3ad065-20240822",

@ -0,0 +1,127 @@
/* tslint:disable */
/* eslint-disable */
/**
* This file was automatically generated by Payload.
* DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,
* and re-run `payload generate:types` to regenerate this file.
*/
export interface Config {
auth: {
users: UserAuthOperations;
};
collections: {
users: User;
media: Media;
'payload-preferences': PayloadPreference;
'payload-migrations': PayloadMigration;
};
db: {
defaultIDType: string;
};
globals: {};
locale: null;
user: User & {
collection: 'users';
};
}
export interface UserAuthOperations {
forgotPassword: {
email: string;
password: string;
};
login: {
email: string;
password: string;
};
registerFirstUser: {
email: string;
password: string;
};
unlock: {
email: string;
password: string;
};
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "users".
*/
export interface User {
id: string;
updatedAt: string;
createdAt: string;
email: string;
resetPasswordToken?: string | null;
resetPasswordExpiration?: string | null;
salt?: string | null;
hash?: string | null;
loginAttempts?: number | null;
lockUntil?: string | null;
password?: string | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "media".
*/
export interface Media {
id: string;
alt?: string | null;
updatedAt: string;
createdAt: string;
url?: string | null;
thumbnailURL?: string | null;
filename?: string | null;
mimeType?: string | null;
filesize?: number | null;
width?: number | null;
height?: number | null;
focalX?: number | null;
focalY?: number | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-preferences".
*/
export interface PayloadPreference {
id: string;
user: {
relationTo: 'users';
value: string | User;
};
key?: string | null;
value?:
| {
[k: string]: unknown;
}
| unknown[]
| string
| number
| boolean
| null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-migrations".
*/
export interface PayloadMigration {
id: string;
name?: string | null;
batch?: number | null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "auth".
*/
export interface Auth {
[k: string]: unknown;
}
declare module 'payload' {
export interface GeneratedTypes extends Config {}
}

@ -0,0 +1,39 @@
import "../globals.css";
import Footer from "@/components/layout/footer";
import { I18nProviderClient } from "@/i18n/client";
import type { Metadata } from "next";
import Navbar from "@/components/layout/navbar";
import { Params } from "./params";
import localFont from "next/font/local";
import { styled } from "@styled-system/jsx";
const moderustic = localFont({
src: "../Moderustic-VariableFont_wght.ttf",
display: "swap",
});
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
export default function RootLayout({
params: { locale },
children,
}: Readonly<{
children: React.ReactNode;
params: Params;
}>) {
return (
<html lang="en">
<I18nProviderClient locale={locale}>
<styled.body className={moderustic.className}>
<Navbar />
<styled.main pb={20}>{children}</styled.main>
<Footer />
</styled.body>
</I18nProviderClient>
</html>
);
}

@ -0,0 +1,8 @@
import { Box } from "styled-system/jsx";
import { getI18n } from "@/i18n/server";
export default async function Home() {
const t = await getI18n();
return <Box></Box>;
}

@ -0,0 +1,3 @@
import { Locale } from "@/i18n/locales";
export type Params = { locale: Locale };

@ -1,44 +1 @@
@layer reset, base, tokens, recipes, utilities; @layer reset, base, tokens, recipes, utilities;
:root {
--background: #ffffff;
--foreground: #171717;
}
@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
}
html,
body {
max-width: 100vw;
overflow-x: hidden;
}
body {
color: var(--foreground);
background: var(--background);
font-family: Arial, Helvetica, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
a {
color: inherit;
text-decoration: none;
}
@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}
}

@ -1,33 +0,0 @@
import type { Metadata } from "next";
import localFont from "next/font/local";
import "./globals.css";
const geistSans = localFont({
src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans",
weight: "100 900",
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono",
weight: "100 900",
});
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={`${geistSans.variable} ${geistMono.variable}`}>
{children}
</body>
</html>
);
}

@ -1,168 +0,0 @@
.page {
--gray-rgb: 0, 0, 0;
--gray-alpha-200: rgba(var(--gray-rgb), 0.08);
--gray-alpha-100: rgba(var(--gray-rgb), 0.05);
--button-primary-hover: #383838;
--button-secondary-hover: #f2f2f2;
display: grid;
grid-template-rows: 20px 1fr 20px;
align-items: center;
justify-items: center;
min-height: 100svh;
padding: 80px;
gap: 64px;
font-family: var(--font-geist-sans);
}
@media (prefers-color-scheme: dark) {
.page {
--gray-rgb: 255, 255, 255;
--gray-alpha-200: rgba(var(--gray-rgb), 0.145);
--gray-alpha-100: rgba(var(--gray-rgb), 0.06);
--button-primary-hover: #ccc;
--button-secondary-hover: #1a1a1a;
}
}
.main {
display: flex;
flex-direction: column;
gap: 32px;
grid-row-start: 2;
}
.main ol {
font-family: var(--font-geist-mono);
padding-left: 0;
margin: 0;
font-size: 14px;
line-height: 24px;
letter-spacing: -0.01em;
list-style-position: inside;
}
.main li:not(:last-of-type) {
margin-bottom: 8px;
}
.main code {
font-family: inherit;
background: var(--gray-alpha-100);
padding: 2px 4px;
border-radius: 4px;
font-weight: 600;
}
.ctas {
display: flex;
gap: 16px;
}
.ctas a {
appearance: none;
border-radius: 128px;
height: 48px;
padding: 0 20px;
border: none;
border: 1px solid transparent;
transition:
background 0.2s,
color 0.2s,
border-color 0.2s;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
line-height: 20px;
font-weight: 500;
}
a.primary {
background: var(--foreground);
color: var(--background);
gap: 8px;
}
a.secondary {
border-color: var(--gray-alpha-200);
min-width: 180px;
}
.footer {
grid-row-start: 3;
display: flex;
gap: 24px;
}
.footer a {
display: flex;
align-items: center;
gap: 8px;
}
.footer img {
flex-shrink: 0;
}
/* Enable hover only on non-touch devices */
@media (hover: hover) and (pointer: fine) {
a.primary:hover {
background: var(--button-primary-hover);
border-color: transparent;
}
a.secondary:hover {
background: var(--button-secondary-hover);
border-color: transparent;
}
.footer a:hover {
text-decoration: underline;
text-underline-offset: 4px;
}
}
@media (max-width: 600px) {
.page {
padding: 32px;
padding-bottom: 80px;
}
.main {
align-items: center;
}
.main ol {
text-align: center;
}
.ctas {
flex-direction: column;
}
.ctas a {
font-size: 14px;
height: 40px;
padding: 0 16px;
}
a.secondary {
min-width: auto;
}
.footer {
flex-wrap: wrap;
align-items: center;
justify-content: center;
}
}
@media (prefers-color-scheme: dark) {
.logo {
filter: invert();
}
}

@ -1,95 +0,0 @@
import Image from "next/image";
import styles from "./page.module.css";
export default function Home() {
return (
<div className={styles.page}>
<main className={styles.main}>
<Image
className={styles.logo}
src="https://nextjs.org/icons/next.svg"
alt="Next.js logo"
width={180}
height={38}
priority
/>
<ol>
<li>
Get started by editing <code>src/app/page.tsx</code>.
</li>
<li>Save and see your changes instantly.</li>
</ol>
<div className={styles.ctas}>
<a
className={styles.primary}
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
className={styles.logo}
src="https://nextjs.org/icons/vercel.svg"
alt="Vercel logomark"
width={20}
height={20}
/>
Deploy now
</a>
<a
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
className={styles.secondary}
>
Read our docs
</a>
</div>
</main>
<footer className={styles.footer}>
<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="https://nextjs.org/icons/file.svg"
alt="File icon"
width={16}
height={16}
/>
Learn
</a>
<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="https://nextjs.org/icons/window.svg"
alt="Window icon"
width={16}
height={16}
/>
Examples
</a>
<a
href="https://nextjs.org?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="https://nextjs.org/icons/globe.svg"
alt="Globe icon"
width={16}
height={16}
/>
Go to nextjs.org
</a>
</footer>
</div>
);
}

@ -0,0 +1,15 @@
import { Text } from "@/components/ui/text";
import { stack } from "@styled-system/patterns";
import { styled } from "@styled-system/jsx";
export default async function Footer() {
return (
<styled.footer
minH={60}
p={8}
className={stack({ gap: 4, justify: "end" })}
>
<Text textAlign="center">Powered by Jenyus</Text>
</styled.footer>
);
}

@ -0,0 +1,41 @@
"use client";
import { defaultLocale, locales } from "@/i18n/locales";
import { useChangeLocale, useCurrentLocale, useI18n } from "@/i18n/client";
import { Button } from "@/components/ui/button";
import { Menu } from "@/components/ui/menu";
export default function LanguagePicker(props: Menu.RootProps) {
const changeLocale = useChangeLocale();
const locale = useCurrentLocale();
const t = useI18n();
return (
<Menu.Root {...props} positioning={{ offset: { crossAxis: -35 } }}>
<Menu.Trigger asChild>
<Button variant="outline" size={props.size}>
{t(`general.${locale}`)}
</Button>
</Menu.Trigger>
<Menu.Positioner>
<Menu.Content right={0}>
<Menu.ItemGroup>
{locales.map((locale) => (
<Menu.Item
asChild
key={locale.code}
value={locale.code}
onClick={() => changeLocale(locale.code)}
>
<Button>
{locale.label[locale.code] ?? locale.label[defaultLocale]}
</Button>
</Menu.Item>
))}
</Menu.ItemGroup>
</Menu.Content>
</Menu.Positioner>
</Menu.Root>
);
}

@ -0,0 +1,68 @@
"use client";
import { Menu, X } from "lucide-react";
import { IconButton } from "@/components/ui/icon-button";
import Image from "next/image";
import Link from "next/link";
import { Media } from "@/payload-types";
import NavLink from "@/components/layout/nav-link";
import { css } from "@styled-system/css";
import { styled } from "@styled-system/jsx";
import { useI18n } from "@/i18n/client";
import { useState } from "react";
export default function MobileNav() {
const [show, setShow] = useState(false);
const t = useI18n();
return (
<styled.div className={css({ display: "block", sm: { display: "none" } })}>
<IconButton onClick={() => setShow((show) => !show)}>
<Menu />
</IconButton>
<styled.div
display={show ? "flex" : "none"}
zIndex={600}
position="fixed"
top={0}
left={0}
right={0}
bottom={0}
height="100%"
width="100%"
flexDir="column"
gap={4}
p={12}
bg="white"
alignItems="center"
onClick={() => setShow(false)}
>
<styled.div alignSelf="stretch" display="flex" justifyContent="end">
<IconButton variant="ghost" onClick={() => setShow(false)}>
<X />
</IconButton>
</styled.div>
<Link href="/" className={css({ fontSize: 24 })}>
Localbites
</Link>
<NavLink href="/">{t("general.home")}</NavLink>
<NavLink href="/about">{t("general.about")}</NavLink>
<NavLink
href="/contact"
type="button"
className={css({
alignSelf: "stretch",
textAlign: "center",
marginTop: "auto",
})}
>
{t("general.contact")}
</NavLink>
</styled.div>
</styled.div>
);
}

@ -0,0 +1,36 @@
import Link, { LinkProps } from "next/link";
import { RecipeVariantProps, cva, cx } from "@styled-system/css";
import { AnchorHTMLAttributes } from "react";
const variants = cva({
base: { _hover: { color: "gray.800" } },
variants: {
type: {
button: {
background: "accent.9",
color: "white",
p: 2,
borderRadius: "md",
_hover: {
background: "accent.11",
},
},
},
},
});
export default function NavLink({
className,
children,
type,
...props
}: RecipeVariantProps<typeof variants> &
Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof LinkProps> &
LinkProps) {
return (
<Link className={cx(variants({ type }), className)} {...props}>
{children}
</Link>
);
}

@ -0,0 +1,57 @@
import { Box, styled } from "@styled-system/jsx";
import LanguagePicker from "./language-picker";
import Link from "next/link";
import MobileNav from "./mobile-nav";
import NavLink from "./nav-link";
import { css } from "@styled-system/css";
import { flex } from "@styled-system/patterns";
import { getI18n } from "@/i18n/server";
export default async function Navbar() {
const t = await getI18n();
return (
<>
<styled.nav
className={flex({ gap: 4 })}
bg="white"
h={20}
px={4}
boxShadow="lg"
alignItems="center"
position="fixed"
zIndex={500}
top={0}
left={0}
right={0}
width="100%"
>
<Link href="/" className={css({ fontSize: 24 })}>
Localbites
</Link>
<styled.div flexGrow={1} />
<NavLink
href="/about"
className={css({ display: "none", sm: { display: "block" } })}
>
{t("general.about")}
</NavLink>
<NavLink
href="/contact"
type="button"
className={css({ display: "none", sm: { display: "block" } })}
>
{t("general.contact")}
</NavLink>
<LanguagePicker />
<MobileNav />
</styled.nav>
<Box h={20} />
</>
);
}

@ -0,0 +1 @@
export { Heading, type HeadingProps } from './styled/heading'

@ -0,0 +1 @@
export { IconButton, type IconButtonProps } from './styled/icon-button'

@ -0,0 +1 @@
export * as Menu from './styled/menu'

@ -0,0 +1,29 @@
import { forwardRef } from 'react'
import { styled } from 'styled-system/jsx'
import { Spinner as StyledSpinner, type SpinnerProps as StyledSpinnerProps } from './styled/spinner'
export interface SpinnerProps extends StyledSpinnerProps {
/**
* For accessibility, it is important to add a fallback loading text.
* This text will be visible to screen readers.
* @default "Loading..."
*/
label?: string
}
export const Spinner = forwardRef<HTMLDivElement, SpinnerProps>((props, ref) => {
const { label = 'Loading...', ...rest } = props
return (
<StyledSpinner
ref={ref}
borderBottomColor="transparent"
borderLeftColor="transparent"
{...rest}
>
{label && <styled.span srOnly>{label}</styled.span>}
</StyledSpinner>
)
})
Spinner.displayName = 'Spinner'

@ -0,0 +1,10 @@
import { styled } from 'styled-system/jsx'
import { type TextVariantProps, text } from 'styled-system/recipes'
import type { ComponentProps, StyledComponent } from 'styled-system/types'
type TextProps = TextVariantProps & { as?: React.ElementType }
export type HeadingProps = ComponentProps<typeof Heading>
export const Heading = styled('h2', text, {
defaultProps: { variant: 'heading' },
}) as StyledComponent<'h2', TextProps>

@ -0,0 +1,9 @@
import { ark } from '@ark-ui/react/factory'
import { styled } from 'styled-system/jsx'
import { type ButtonVariantProps, button } from 'styled-system/recipes'
import type { ComponentProps } from 'styled-system/types'
export type IconButtonProps = ComponentProps<typeof IconButton>
export const IconButton = styled(ark.button, button, {
defaultProps: { px: '0' } as ButtonVariantProps,
})

@ -0,0 +1,103 @@
'use client'
import type { Assign } from '@ark-ui/react'
import { Menu } from '@ark-ui/react/menu'
import { type MenuVariantProps, menu } from 'styled-system/recipes'
import type { ComponentProps, HTMLStyledProps } from 'styled-system/types'
import { createStyleContext } from './utils/create-style-context'
const { withRootProvider, withContext } = createStyleContext(menu)
export type RootProviderProps = ComponentProps<typeof RootProvider>
export const RootProvider = withRootProvider<Assign<Menu.RootProviderProps, MenuVariantProps>>(
Menu.RootProvider,
)
export type RootProps = ComponentProps<typeof Root>
export const Root = withRootProvider<Assign<Menu.RootProps, MenuVariantProps>>(Menu.Root)
export const Arrow = withContext<
HTMLDivElement,
Assign<HTMLStyledProps<'div'>, Menu.ArrowBaseProps>
>(Menu.Arrow, 'arrow')
export const ArrowTip = withContext<
HTMLDivElement,
Assign<HTMLStyledProps<'div'>, Menu.ArrowTipBaseProps>
>(Menu.ArrowTip, 'arrowTip')
export const CheckboxItem = withContext<
HTMLDivElement,
Assign<HTMLStyledProps<'div'>, Menu.CheckboxItemBaseProps>
>(Menu.CheckboxItem, 'item')
export const Content = withContext<
HTMLDivElement,
Assign<HTMLStyledProps<'div'>, Menu.ContentBaseProps>
>(Menu.Content, 'content')
export const ContextTrigger = withContext<
HTMLButtonElement,
Assign<HTMLStyledProps<'button'>, Menu.ContextTriggerBaseProps>
>(Menu.ContextTrigger, 'contextTrigger')
export const Indicator = withContext<
HTMLDivElement,
Assign<HTMLStyledProps<'div'>, Menu.IndicatorBaseProps>
>(Menu.Indicator, 'indicator')
export const ItemGroupLabel = withContext<
HTMLDivElement,
Assign<HTMLStyledProps<'div'>, Menu.ItemGroupLabelBaseProps>
>(Menu.ItemGroupLabel, 'itemGroupLabel')
export const ItemGroup = withContext<
HTMLDivElement,
Assign<HTMLStyledProps<'div'>, Menu.ItemGroupBaseProps>
>(Menu.ItemGroup, 'itemGroup')
export const ItemIndicator = withContext<
HTMLDivElement,
Assign<HTMLStyledProps<'div'>, Menu.ItemIndicatorBaseProps>
>(Menu.ItemIndicator, 'itemIndicator')
export const Item = withContext<HTMLDivElement, Assign<HTMLStyledProps<'div'>, Menu.ItemBaseProps>>(
Menu.Item,
'item',
)
export const ItemText = withContext<
HTMLDivElement,
Assign<HTMLStyledProps<'div'>, Menu.ItemTextBaseProps>
>(Menu.ItemText, 'itemText')
export const Positioner = withContext<
HTMLDivElement,
Assign<HTMLStyledProps<'div'>, Menu.PositionerBaseProps>
>(Menu.Positioner, 'positioner')
export const RadioItemGroup = withContext<
HTMLDivElement,
Assign<HTMLStyledProps<'div'>, Menu.RadioItemGroupBaseProps>
>(Menu.RadioItemGroup, 'itemGroup')
export const RadioItem = withContext<
HTMLDivElement,
Assign<HTMLStyledProps<'div'>, Menu.RadioItemBaseProps>
>(Menu.RadioItem, 'item')
export const Separator = withContext<
HTMLHRElement,
Assign<HTMLStyledProps<'hr'>, Menu.SeparatorBaseProps>
>(Menu.Separator, 'separator')
export const TriggerItem = withContext<
HTMLDivElement,
Assign<HTMLStyledProps<'div'>, Menu.TriggerItemBaseProps>
>(Menu.TriggerItem, 'triggerItem')
export const Trigger = withContext<
HTMLButtonElement,
Assign<HTMLStyledProps<'button'>, Menu.TriggerBaseProps>
>(Menu.Trigger, 'trigger')
export { MenuContext as Context } from '@ark-ui/react/menu'

@ -0,0 +1,7 @@
import { ark } from '@ark-ui/react/factory'
import { styled } from 'styled-system/jsx'
import { spinner } from 'styled-system/recipes'
import type { ComponentProps } from 'styled-system/types'
export type SpinnerProps = ComponentProps<typeof Spinner>
export const Spinner = styled(ark.div, spinner)

@ -0,0 +1,8 @@
import { styled } from 'styled-system/jsx'
import { type TextVariantProps, text } from 'styled-system/recipes'
import type { ComponentProps, StyledComponent } from 'styled-system/types'
type ParagraphProps = TextVariantProps & { as?: React.ElementType }
export type TextProps = ComponentProps<typeof Text>
export const Text = styled('p', text) as StyledComponent<'p', ParagraphProps>

@ -0,0 +1 @@
export { Text, type TextProps } from './styled/text'

@ -0,0 +1,12 @@
"use client";
import { createI18nClient } from "next-international/client";
import { importedLocales } from "./locales";
export const {
useI18n,
useScopedI18n,
I18nProviderClient,
useChangeLocale,
useCurrentLocale,
} = createI18nClient(importedLocales);

@ -0,0 +1,6 @@
export default {
general: {
home: "Startseite",
getStarted: "Um zu starten bearbeiten Sie",
},
} as const;

@ -0,0 +1,6 @@
export default {
general: {
home: "Home",
getStarted: "Get started by editing",
},
} as const;

@ -0,0 +1,29 @@
export const locales = [
{
label: {
de: "Deutsch",
en: "German",
fr: "Allemand",
it: "Tedesco",
},
code: "de",
},
{
label: {
de: "Englisch",
en: "English",
it: "Inglese",
fr: "Anglais",
},
code: "en",
},
] as const;
export type Locale = (typeof locales)[number]["code"];
export const defaultLocale: Locale = "de";
export const importedLocales = {
de: () => import("./de"),
en: () => import("./en"),
} as const;

@ -0,0 +1,16 @@
import { Locale, importedLocales } from "./locales";
import {
createI18nServer,
setStaticParamsLocale,
} from "next-international/server";
export const { getI18n, getScopedI18n, getStaticParams, getCurrentLocale } =
createI18nServer(importedLocales);
export const getLocalizedI18n = async (locale: Locale) => {
const prevLocale = getCurrentLocale();
setStaticParamsLocale(locale);
return [await getI18n(), () => setStaticParamsLocale(prevLocale)] as const;
};

@ -0,0 +1,18 @@
import { defaultLocale, locales } from "@/i18n/locales";
import { NextRequest } from "next/server";
import { createI18nMiddleware } from "next-international/middleware";
const I18nMiddleware = createI18nMiddleware({
locales: locales.map(({ code }) => code),
defaultLocale,
urlMappingStrategy: "rewriteDefault",
});
export function middleware(request: NextRequest) {
return I18nMiddleware(request);
}
export const config = {
matcher: ["/((?!api|admin|static|.*\\..*|_next|favicon.ico|robots.txt).*)"],
};

@ -1,7 +1,11 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "ES2017", "target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"], "lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"strict": true, "strict": true,
@ -19,12 +23,28 @@
} }
], ],
"paths": { "paths": {
"@/*": ["./src/*"], "@/*": [
"./src/*"
],
"@styled-system/*": [
"./styled-system/*"
],
"styled-system/*": [
"./styled-system/*"
],
"@payload-config": [ "@payload-config": [
"./payload.config.ts" "./payload.config.ts"
] ]
} }
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "next.config.mts"], "include": [
"exclude": ["node_modules"] "next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"next.config.mts"
],
"exclude": [
"node_modules"
]
} }

@ -1580,10 +1580,10 @@
dependencies: dependencies:
sparse-bitfield "^3.0.3" sparse-bitfield "^3.0.3"
"@next/env@15.0.0-canary.132": "@next/env@15.0.0-canary.134":
version "15.0.0-canary.132" version "15.0.0-canary.134"
resolved "https://registry.yarnpkg.com/@next/env/-/env-15.0.0-canary.132.tgz#dd1596099bede0a07ed8e49afe4e80d672b618d6" resolved "https://registry.yarnpkg.com/@next/env/-/env-15.0.0-canary.134.tgz#2a00bd6eb0afcc4195e8585413c5611d3952558d"
integrity sha512-LiiDwp0+VWngu3KFcZI/cEyLNEmwpRBJf2jiZJadaJdwQEggiWsageYeZZioAHzqN5aoiBprqquKcbAslBgFbw== integrity sha512-EfKmizmy7YFPcJeBrYTt8dQbnUdM8SInWOtEyn1qGynf6rwoqp7lMlz2s1p4L6bfRs8B5kqj5Y8XzM5itE3sAA==
"@next/env@^15.0.0-canary.104": "@next/env@^15.0.0-canary.104":
version "15.0.0-rc.0" version "15.0.0-rc.0"
@ -1597,50 +1597,50 @@
dependencies: dependencies:
fast-glob "3.3.1" fast-glob "3.3.1"
"@next/swc-darwin-arm64@15.0.0-canary.132": "@next/swc-darwin-arm64@15.0.0-canary.134":
version "15.0.0-canary.132" version "15.0.0-canary.134"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.0.0-canary.132.tgz#90e0bcef5cad8d7ace8f3cb629ffb770d3d08bd6" resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.0.0-canary.134.tgz#6f78db9ff3792b622210c41a6d16619aade138fc"
integrity sha512-XsaK6Xl5Zt1CnDt+mDbs3c8YQKQuNiKT+92dKeVNjy3WthgEm/VeqzGIIz0+kvDKSSm25rX8T2tiM0VbCdXodQ== integrity sha512-jUnNZtuZZpoCO5t6xnbrrWa3ZJafpeDRAZbtFo+g5cTC+toMZTW7Zu+E4j5na1SYLfaOEEbZJ017q9qxZoWLiQ==
"@next/swc-darwin-x64@15.0.0-canary.132": "@next/swc-darwin-x64@15.0.0-canary.134":
version "15.0.0-canary.132" version "15.0.0-canary.134"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-15.0.0-canary.132.tgz#54efb35fbfd319b19d23021d429515ebde390fe0" resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-15.0.0-canary.134.tgz#dffdddf125e00069e1c7d4bb56c2f74140631840"
integrity sha512-rTzeDjh57LOA56RqP71g9nqz32LOFPha2ZI7qS2i1dbVl4msAiWBCWnAX6yV6jykx/35wxgU1WK88AWDV/lclw== integrity sha512-vQxFt/PAJkkgq0k4YtlysP1jxAHtTHvEtCLvebRQvxURlVO1BVZAHPmbrnPZ9qt0vYzkKmQ6tCI03aHEdD7F7w==
"@next/swc-linux-arm64-gnu@15.0.0-canary.132": "@next/swc-linux-arm64-gnu@15.0.0-canary.134":
version "15.0.0-canary.132" version "15.0.0-canary.134"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.0.0-canary.132.tgz#e18e5f1fe0490576970b509ae621825f8bae88de" resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.0.0-canary.134.tgz#76b8974b17bc6773d69e2cc98e146ff0e18879b7"
integrity sha512-kxYNpuDtaz0LIBEORIh5tHhgdM2kLhzrWavZ1EmpUyBRbReLfjFXbBVlUq5C3uWnWjUCyGcpEtyoX7pMDjH0Og== integrity sha512-1HPDXP87lETfkLUxYUfYhybpTZ64Z62NArkeSG9VrlI4ON8dwCTfIWQ9XqK3qnIgkzgAwkvaX9OYF3S6v3F4RA==
"@next/swc-linux-arm64-musl@15.0.0-canary.132": "@next/swc-linux-arm64-musl@15.0.0-canary.134":
version "15.0.0-canary.132" version "15.0.0-canary.134"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.0.0-canary.132.tgz#5a4afea79fe748c0896cc8362bb8f5e00c2e1ba8" resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.0.0-canary.134.tgz#2229d87832498d63df222a60c2f7310e057fd258"
integrity sha512-iGgEknY0mAbybACDIvZujdt72d2a5k6YxpUJ1ieYnx9VohXrIqr3idfaC6bMoWyQ7R/17n7D6MwxV2WrXrx1pQ== integrity sha512-6Jpr3KD9qc/27er07/kAWuMn+GeO+mn7X7OcOrpw+Rr3uN1/IBxcdaG+b5W62G1Safhr3YC0m1ic6Syhj+mtUA==
"@next/swc-linux-x64-gnu@15.0.0-canary.132": "@next/swc-linux-x64-gnu@15.0.0-canary.134":
version "15.0.0-canary.132" version "15.0.0-canary.134"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.0.0-canary.132.tgz#595892fe29d63a2b7c4e3550b890b4fc942355d8" resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.0.0-canary.134.tgz#16ffb0f7fef4cf69e8668ee2eec6e31d5fb7070e"
integrity sha512-t0IRcCybvUW+4EMF1BSu2sz4yoPREUDfL5U8XviOII8C9mC9Mqr7C3V6UTtK7qEqqE8uZ646jUzLRLSq/dFu/Q== integrity sha512-oNV8mlBQIvgr+3DVlslMh2sYVirN6v14ecTwr/q0FvJiB5atyIx0tBfU9mpguibcswaqjYOk2H8ZupRO7l3TAA==
"@next/swc-linux-x64-musl@15.0.0-canary.132": "@next/swc-linux-x64-musl@15.0.0-canary.134":
version "15.0.0-canary.132" version "15.0.0-canary.134"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.0.0-canary.132.tgz#29519d1a0afddfdbccf0057ca5a304b8f78246c7" resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.0.0-canary.134.tgz#085dd8dec3b3d58a481c50ff8d3311fb2f9c68bc"
integrity sha512-TEN6F1usz7n2w86qMMOCiqk5Fj1B5Gq1f9ymubC40V+pWSfA77tqR8aUG97HrrGZuAifXQyaqK+9yVAIQX81gQ== integrity sha512-rdChZZlC84EhmFhdMLXTqpVGD8BJVw34/tuKp/BlJIwXr9ubgvmhWDwe9EQZ0OJ6qnTJJwWICk66SZufRhue2w==
"@next/swc-win32-arm64-msvc@15.0.0-canary.132": "@next/swc-win32-arm64-msvc@15.0.0-canary.134":
version "15.0.0-canary.132" version "15.0.0-canary.134"
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.0.0-canary.132.tgz#f41f5fe9b7096df5f4996f73a802a877fce5d973" resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.0.0-canary.134.tgz#aad909b6173f321f7f8c118f2c34e05db3ee3dd6"
integrity sha512-VBMglYngxTbQQGgHcg7KASoT4EZhGsEKXlZIjiU0a2PxT7tgMCLlgOlcuUy9sqN67jezRQGNqqcU4W+K+krDMA== integrity sha512-wx245GKxIyY63ZTt5fd7bMcgBgRBsttYbvAqA+n0hV9BtyHFifd7mMG7O8QiUlBo1xiADt0iZIoOE4tdwnQ2KA==
"@next/swc-win32-ia32-msvc@15.0.0-canary.132": "@next/swc-win32-ia32-msvc@15.0.0-canary.134":
version "15.0.0-canary.132" version "15.0.0-canary.134"
resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-15.0.0-canary.132.tgz#d394d954799c27f0018c5ae2e3f8d757713768d9" resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-15.0.0-canary.134.tgz#92379ea646b4464f8f834fec785537227bc1c1d5"
integrity sha512-XNfYnhHWmOVu37aLVpMDRYxBNU46mSymapNyD7uy+C3QN7k3ZXPxy9Qb+OJkDx/SlfHBfSi0Ncp1cw6ptiD++A== integrity sha512-0mz4KajqtrnxufGxk0VK3xepXm305uaRYbWPlRvfXbOA1jqMuCRjpvxcEoSlXgG/PXwMFFHfXBDQBClY4rv37A==
"@next/swc-win32-x64-msvc@15.0.0-canary.132": "@next/swc-win32-x64-msvc@15.0.0-canary.134":
version "15.0.0-canary.132" version "15.0.0-canary.134"
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.0.0-canary.132.tgz#0beb83b912a708febee94924e7f09235de07cd6e" resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.0.0-canary.134.tgz#e9a65069d34db5e8d45b20b56f251a6327c47284"
integrity sha512-uUyW1CAUYawCnpNVSHJyS37xBSi/hlhi5i4yFJ/K1bj31d7m/xQogrAfMybO6+tIqBKOkzva+oprkfFyrlWC/w== integrity sha512-fRfsT9u6xbUQsvVhzHmTbdpVtGSH1xMAePOdQo5f+jE/VlK48wsY+bxi0xI4MS9RCucPgd9bziq8xM12D6i9bg==
"@nodelib/fs.scandir@2.1.5": "@nodelib/fs.scandir@2.1.5":
version "2.1.5" version "2.1.5"
@ -4369,7 +4369,7 @@ cli-color@^2.0.2:
memoizee "^0.4.15" memoizee "^0.4.15"
timers-ext "^0.1.7" timers-ext "^0.1.7"
client-only@0.0.1: client-only@0.0.1, client-only@^0.0.1:
version "0.0.1" version "0.0.1"
resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1" resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1"
integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA== integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==
@ -5670,6 +5670,11 @@ internal-slot@^1.0.4, internal-slot@^1.0.7:
hasown "^2.0.0" hasown "^2.0.0"
side-channel "^1.0.4" side-channel "^1.0.4"
international-types@^0.8.1:
version "0.8.1"
resolved "https://registry.yarnpkg.com/international-types/-/international-types-0.8.1.tgz#c0e593d9911c1a23f64bbd6eb1abb2941fe2353f"
integrity sha512-tajBCAHo4I0LIFlmQ9ZWfjMWVyRffzuvfbXCd6ssFt5u1Zw15DN0UBpVTItXdNa1ls+cpQt3Yw8+TxsfGF8JcA==
ip-address@^9.0.5: ip-address@^9.0.5:
version "9.0.5" version "9.0.5"
resolved "https://registry.yarnpkg.com/ip-address/-/ip-address-9.0.5.tgz#117a960819b08780c3bd1f14ef3c1cc1d3f3ea5a" resolved "https://registry.yarnpkg.com/ip-address/-/ip-address-9.0.5.tgz#117a960819b08780c3bd1f14ef3c1cc1d3f3ea5a"
@ -6416,17 +6421,26 @@ natural-compare@^1.4.0:
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
next-international@^1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/next-international/-/next-international-1.2.4.tgz#abe50b2aa3ba7ecf92d41f87537796a4b2dd0ba3"
integrity sha512-JQvp+h2iSgA/t8hu5S/Lwow1ZErJutQRdpnplxjv4VTlCiND8T95fYih8BjkHcVhQbtM+Wu9Mb1CM32wD9hlWQ==
dependencies:
client-only "^0.0.1"
international-types "^0.8.1"
server-only "^0.0.1"
next-tick@^1.1.0: next-tick@^1.1.0:
version "1.1.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb"
integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==
next@15.0.0-canary.132: next@^15.0.0-canary.134:
version "15.0.0-canary.132" version "15.0.0-canary.134"
resolved "https://registry.yarnpkg.com/next/-/next-15.0.0-canary.132.tgz#e6b15bde51e28bb4afd4c3a79a0b1364741f9d7b" resolved "https://registry.yarnpkg.com/next/-/next-15.0.0-canary.134.tgz#9d8932eda352ed3cbf1298c35b2688b09b632df3"
integrity sha512-bem2cDB95PABbIcOVwBm8ysk4WLmZRf+EViF7Rx0LYufEswyTsBW8/vO+sUeFh9Ors7c+nnLP6yp+fSSXLShgw== integrity sha512-R+Xh+djtCT/14rdZ0+afypzZTSNiDEoCrEpdf5DY/8rVUpl/9WPhlhN3M1/43PSZ3eF6eIW4xw/IJepwnK7qkg==
dependencies: dependencies:
"@next/env" "15.0.0-canary.132" "@next/env" "15.0.0-canary.134"
"@swc/counter" "0.1.3" "@swc/counter" "0.1.3"
"@swc/helpers" "0.5.12" "@swc/helpers" "0.5.12"
busboy "1.6.0" busboy "1.6.0"
@ -6435,15 +6449,15 @@ next@15.0.0-canary.132:
postcss "8.4.31" postcss "8.4.31"
styled-jsx "5.1.6" styled-jsx "5.1.6"
optionalDependencies: optionalDependencies:
"@next/swc-darwin-arm64" "15.0.0-canary.132" "@next/swc-darwin-arm64" "15.0.0-canary.134"
"@next/swc-darwin-x64" "15.0.0-canary.132" "@next/swc-darwin-x64" "15.0.0-canary.134"
"@next/swc-linux-arm64-gnu" "15.0.0-canary.132" "@next/swc-linux-arm64-gnu" "15.0.0-canary.134"
"@next/swc-linux-arm64-musl" "15.0.0-canary.132" "@next/swc-linux-arm64-musl" "15.0.0-canary.134"
"@next/swc-linux-x64-gnu" "15.0.0-canary.132" "@next/swc-linux-x64-gnu" "15.0.0-canary.134"
"@next/swc-linux-x64-musl" "15.0.0-canary.132" "@next/swc-linux-x64-musl" "15.0.0-canary.134"
"@next/swc-win32-arm64-msvc" "15.0.0-canary.132" "@next/swc-win32-arm64-msvc" "15.0.0-canary.134"
"@next/swc-win32-ia32-msvc" "15.0.0-canary.132" "@next/swc-win32-ia32-msvc" "15.0.0-canary.134"
"@next/swc-win32-x64-msvc" "15.0.0-canary.132" "@next/swc-win32-x64-msvc" "15.0.0-canary.134"
sharp "^0.33.4" sharp "^0.33.4"
node-eval@^2.0.0: node-eval@^2.0.0:
@ -7266,6 +7280,11 @@ semver@^7.3.8, semver@^7.6.0, semver@^7.6.3:
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143"
integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==
server-only@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/server-only/-/server-only-0.0.1.tgz#0f366bb6afb618c37c9255a314535dc412cd1c9e"
integrity sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==
set-function-length@^1.2.1: set-function-length@^1.2.1:
version "1.2.2" version "1.2.2"
resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449"

Loading…
Cancel
Save