diff --git a/.env.example b/.env.example index 9ac741a18..3f31f2612 100644 --- a/.env.example +++ b/.env.example @@ -16,6 +16,16 @@ VERCEL_GIT_COMMIT_AUTHOR_LOGIN="" VERCEL_GIT_COMMIT_AUTHOR_NAME="" VERCEL_GIT_PULL_REQUEST_ID="" +# Sanity +NEXT_PUBLIC_SANITY_PROJECT_ID="" +NEXT_PUBLIC_SANITY_DATASET="" +NEXT_PUBLIC_SANITY_API_VERSION="" + +# Preview +SANITY_API_READ_TOKEN="" +SANITY_WEBHOOK_SECRET="" + +# Site TWITTER_CREATOR="@kodamera" TWITTER_SITE="https://kodamera.se" SITE_NAME="KM Storefront" diff --git a/app/[locale]/globals.css b/app/[locale]/globals.css index d66461eab..2d7943a69 100644 --- a/app/[locale]/globals.css +++ b/app/[locale]/globals.css @@ -2,9 +2,76 @@ @tailwind components; @tailwind utilities; -@supports (font: -apple-system-body) and (-webkit-appearance: none) { - img[loading='lazy'] { - clip-path: inset(0.6px); +@layer base { + :root { + --background: 0 0% 100%; + --foreground: 0 0% 3.9%; + + --card: 0 0% 100%; + --card-foreground: 0 0% 3.9%; + + --popover: 0 0% 100%; + --popover-foreground: 0 0% 3.9%; + + --primary: 0 0% 9%; + --primary-foreground: 0 0% 98%; + + --secondary: 0 0% 96.1%; + --secondary-foreground: 0 0% 9%; + + --muted: 0 0% 96.1%; + --muted-foreground: 0 0% 45.1%; + + --accent: 0 0% 96.1%; + --accent-foreground: 0 0% 9%; + + --destructive: 0 84.2% 60.2%; + --destructive-foreground: 0 0% 98%; + + --border: 0 0% 89.8%; + --input: 0 0% 89.8%; + --ring: 0 0% 3.9%; + + --radius: 0.5rem; + } + + .dark { + --background: 0 0% 3.9%; + --foreground: 0 0% 98%; + + --card: 0 0% 3.9%; + --card-foreground: 0 0% 98%; + + --popover: 0 0% 3.9%; + --popover-foreground: 0 0% 98%; + + --primary: 0 0% 98%; + --primary-foreground: 0 0% 9%; + + --secondary: 0 0% 14.9%; + --secondary-foreground: 0 0% 98%; + + --muted: 0 0% 14.9%; + --muted-foreground: 0 0% 63.9%; + + --accent: 0 0% 14.9%; + --accent-foreground: 0 0% 98%; + + --destructive: 0 62.8% 30.6%; + --destructive-foreground: 0 0% 98%; + + --border: 0 0% 14.9%; + --input: 0 0% 14.9%; + --ring: 0 0% 83.1%; + } +} + +@layer base { + * { + @apply border-border; + } + body { + @apply bg-background text-foreground; } } @@ -28,7 +95,7 @@ html, body { - @apply font-sans h-full bg-white text-high-contrast; + @apply h-full bg-white font-sans text-high-contrast; box-sizing: border-box; touch-action: manipulation; @@ -74,11 +141,11 @@ body { } .glider-dots { - @apply flex !space-x-[2px] !mt-8; + @apply !mt-8 flex !space-x-[2px]; } .glider-dot { - @apply !m-0 !rounded-none !w-12 !h-4 !bg-transparent after:content-[''] after:block after:w-12 after:h-[3px] after:bg-ui-border 2xl:!w-16 2xl:after:w-16; + @apply !m-0 !h-4 !w-12 !rounded-none !bg-transparent after:block after:h-[3px] after:w-12 after:bg-ui-border after:content-[''] 2xl:!w-16 2xl:after:w-16; } .glider-dot.active { @@ -86,17 +153,17 @@ body { } .glider-prev { - @apply text-high-contrast !right-12 !-top-10 !left-auto lg:!right-16 lg:!-top-12 2xl:!-top-16 2xl:!right-[100px] !transition-transform !duration-100 hover:!text-high-contrast hover:scale-110; + @apply !-top-10 !left-auto !right-12 text-high-contrast !transition-transform !duration-100 hover:scale-110 hover:!text-high-contrast lg:!-top-10 lg:!right-16 2xl:!-top-12 2xl:!right-[100px]; } .glider-next { - @apply text-high-contrast !right-4 !-top-10 lg:!right-8 lg:!-top-12 2xl:!-top-16 2xl:!right-16 !transition-transform !duration-100 hover:!text-high-contrast hover:scale-110; + @apply !-top-10 !right-4 text-high-contrast !transition-transform !duration-100 hover:scale-110 hover:!text-high-contrast lg:!-top-10 lg:!right-8 2xl:!-top-12 2xl:!right-16; } .pdp .glider-prev { - @apply text-high-contrast absolute !left-4 !top-1/2 !transition-transform !duration-100 hover:!text-high-contrast hover:scale-100 lg:hidden; + @apply absolute !left-4 !top-1/2 text-high-contrast !transition-transform !duration-100 hover:scale-100 hover:!text-high-contrast lg:hidden; } .pdp .glider-next { - @apply text-high-contrast absolute !right-4 !top-1/2 !transition-transform !duration-100 hover:!text-high-contrast hover:scale-100 lg:hidden; -} \ No newline at end of file + @apply absolute !right-4 !top-1/2 text-high-contrast !transition-transform !duration-100 hover:scale-100 hover:!text-high-contrast lg:hidden; +} diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index e8999055b..0546880c4 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -1,9 +1,10 @@ import Footer from 'components/layout/footer/footer'; import Header from 'components/layout/header/header'; -import { useLocale } from 'next-intl'; +import { NextIntlClientProvider } from 'next-intl'; import { Inter } from 'next/font/google'; import { notFound } from 'next/navigation'; import { ReactNode } from 'react'; +import { supportedLanguages } from '../../i18n-config'; import './globals.css'; export const metadata = { @@ -32,30 +33,34 @@ const inter = Inter({ variable: '--font-inter' }); -// export function generateStaticParams() { -// return supportedLanguages.locales.map((locale) => ({ locale: locale.id })); -// } +export function generateStaticParams() { + return supportedLanguages.locales.map((locale) => ({ locale: locale.id })); +} -export default function LocaleLayout({ - children, - params -}: { +interface LocaleLayoutProps { children: ReactNode; - params: { locale: string }; -}) { - const locale = useLocale(); + params: { + locale: string; + }; +} - // Show a 404 error if the user requests an unknown locale - if (params.locale !== locale) { +export default async function LocaleLayout({ children, params: { locale } }: LocaleLayoutProps) { + let messages; + + try { + messages = (await import(`../../messages/${locale}.json`)).default; + } catch (error) { notFound(); } return ( -
-
{children}
-