This commit is contained in:
Henrik Larsson 2023-07-03 13:44:09 +02:00
parent bcec144e68
commit eecef825c5

View File

@ -6,12 +6,12 @@ import { notFound } from 'next/navigation';
import { ReactNode } from 'react'; import { ReactNode } from 'react';
import './globals.css'; import './globals.css';
const SITE_NAME = "KM Storefront" const SITE_NAME = 'KM Storefront';
const SITE_DESCRIPTION = "Webb och digitalbyrå från Göteborg" const SITE_DESCRIPTION = 'Webb och digitalbyrå från Göteborg';
const TWITTER_CREATOR = "@kodamera.se" const TWITTER_CREATOR = '@kodamera.se';
const TWITTER_SITE = "https://kodamera.se" const TWITTER_SITE = 'https://kodamera.se';
const OG_IMAGE_URL = "/og-image.jpg" const OG_IMAGE_URL = '/og-image.jpg';
const OG_IMAGE_ALT = "Kodamera" const OG_IMAGE_ALT = 'Kodamera';
export const metadata = { export const metadata = {
title: { title: {
@ -26,8 +26,8 @@ export const metadata = {
width: 1200, width: 1200,
height: 630, height: 630,
alt: OG_IMAGE_ALT alt: OG_IMAGE_ALT
}, }
], ]
}, },
robots: { robots: {
follow: true, follow: true,
@ -50,17 +50,17 @@ const inter = Inter({
}); });
export function generateStaticParams() { export function generateStaticParams() {
return [{locale: 'sv'}, {locale: 'en'}]; return [{ locale: 'sv' }, { locale: 'en' }];
} }
interface LocaleLayoutProps { interface LocaleLayoutProps {
children: ReactNode children: ReactNode;
params: { params: {
locale: string locale: string;
} };
} }
export default async function LocaleLayout({children, params: {locale}}: LocaleLayoutProps) { export default async function LocaleLayout({ children, params: { locale } }: LocaleLayoutProps) {
let messages; let messages;
try { try {
@ -71,17 +71,13 @@ export default async function LocaleLayout({children, params: {locale}}: LocaleL
return ( return (
<html lang={locale} className={inter.variable}> <html lang={locale} className={inter.variable}>
<body className="flex flex-col min-h-screen"> <body className="flex min-h-screen flex-col">
<NextIntlClientProvider locale={locale} messages={messages}> <NextIntlClientProvider locale={locale} messages={messages}>
<Header /> <Header />
<main className="flex-1"> <main className="flex-1">{children}</main>
{children}
</main>
<Footer /> <Footer />
</NextIntlClientProvider> </NextIntlClientProvider>
</body> </body>
</html> </html>
); );
} }