Skip to content

Commit

Permalink
feat: static adfit page
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Oct 8, 2023
1 parent f81f916 commit 9af6c7e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
15 changes: 15 additions & 0 deletions app/adfit/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export const metadata = {
title: 'AdFit Responsive',
}

export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
)
}
25 changes: 25 additions & 0 deletions app/adfit/page.tsx
Original file line number Diff line number Diff line change
@@ -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<ReactElement> {
return (
<AdFitResponsive
className={clsx('mx-6 mb-2', 'mx-0')}
adfitClassName="adfit-top"
units={{
mobile: 'DAN-dAqcoLWvKpYEtbtq',
pc: 'DAN-SEcRVdSHkh05H0jO',
}}
/>
);
}
2 changes: 1 addition & 1 deletion src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 9af6c7e

Please sign in to comment.