From 9af6c7e3ed19c5f975bc71c058fd48ba7c875728 Mon Sep 17 00:00:00 2001 From: hyochan Date: Sun, 8 Oct 2023 21:23:46 +0900 Subject: [PATCH] feat: static adfit page --- app/adfit/layout.tsx | 15 +++++++++++++++ app/adfit/page.tsx | 25 +++++++++++++++++++++++++ src/middleware.ts | 2 +- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 app/adfit/layout.tsx create mode 100644 app/adfit/page.tsx diff --git a/app/adfit/layout.tsx b/app/adfit/layout.tsx new file mode 100644 index 0000000..3be5ef1 --- /dev/null +++ b/app/adfit/layout.tsx @@ -0,0 +1,15 @@ +export const metadata = { + title: 'AdFit Responsive', +} + +export default function RootLayout({ + children, +}: { + children: React.ReactNode +}) { + return ( + + {children} + + ) +} diff --git a/app/adfit/page.tsx b/app/adfit/page.tsx new file mode 100644 index 0000000..9c7a0c0 --- /dev/null +++ b/app/adfit/page.tsx @@ -0,0 +1,25 @@ +import type {ReactElement} from 'react'; +import clsx from 'clsx'; +import {Inter} from 'next/font/google'; + +import type {Locale} from '~/i18n'; +import AdFitResponsive from '../[lang]/(common)/AdFitResponsive'; + +const inter = Inter({subsets: ['latin']}); + +type Props = { + params: {lang: Locale}; +}; + +export default async function Page({}: Props): Promise { + return ( + + ); +} diff --git a/src/middleware.ts b/src/middleware.ts index 9d6e68f..8b79335 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -46,7 +46,7 @@ export async function middleware( }); // Redirect if there is no locale - if (pathnameIsMissingLocale) { + if (!pathname.startsWith('/adfit') && pathnameIsMissingLocale) { const locale = getLocale(req); const origin = new URL(req.url).origin;