Skip to content

Commit

Permalink
Merge pull request #111 from JohnsonMao/style/container
Browse files Browse the repository at this point in the history
🔧 remove experimental -> appDir

💄 update web style
  • Loading branch information
JohnsonMao authored Nov 1, 2023
2 parents b6e79ab + c087bdc commit 4bbad58
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 19 deletions.
1 change: 0 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
const nextConfig = {
reactStrictMode: true,
experimental: {
appDir: true,
typedRoutes: true,
},
images: {
Expand Down
18 changes: 11 additions & 7 deletions src/app/[lang]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ async function RootPage({ params: { lang } }: RootParams) {
const { metadata } = await getDictionary(lang);

return (
<Container as="main">
<H1 className="py-4 text-3xl font-bold dark:text-white">
{metadata.title}
</H1>
<p className="pb-12 text-xl dark:text-white">{metadata.description}</p>
<List Item={Card} items={posts} />
</Container>
<>
<Container className="py-8">
<H1 className="mb-4 text-3xl font-bold dark:text-white">
{metadata.title}
</H1>
<p className="text-xl dark:text-white">{metadata.description}</p>
</Container>
<Container as="main" className="py-8">
<List Item={Card} items={posts} />
</Container>
</>
);
}

Expand Down
8 changes: 5 additions & 3 deletions src/app/[lang]/posts/[postId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ async function PostPage({ params: { postId } }: PostParams) {

return (
<>
<Container as="main">
<H1 className="py-4 text-3xl font-bold dark:text-white">
<Container className="py-8">
<H1 className="mb-4 text-3xl font-bold dark:text-white">
{frontmatter.title}
</H1>
<time className="mt-0">{formattedDate}</time>
<time>{formattedDate}</time>
</Container>
<Container as="main" className="py-8">
<article className="prose prose-xl prose-slate mx-auto dark:prose-invert">
{content}
</article>
Expand Down
18 changes: 11 additions & 7 deletions src/app/[lang]/posts/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ async function RootPage({ params: { lang } }: RootParams) {
const { metadata } = await getDictionary(lang);

return (
<Container as="main">
<H1 className="py-4 text-3xl font-bold dark:text-white">
{metadata.title}
</H1>
<p className="pb-12 text-xl dark:text-white">{metadata.description}</p>
<List Item={Card} items={posts} />
</Container>
<>
<Container className="py-8">
<H1 className="mb-4 text-3xl font-bold dark:text-white">
{metadata.title}
</H1>
<p className="text-xl dark:text-white">{metadata.description}</p>
</Container>
<Container as="main" className="py-8">
<List Item={Card} items={posts} />
</Container>
</>
);
}

Expand Down
3 changes: 2 additions & 1 deletion src/components/Container/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const Container = forwardRef<HTMLDivElement, ContainerProps>(
<Component
className={cn(
'px-7 md:mx-8 lg:mx-16 lg:px-14',
as === 'main' && 'border-2 rounded-lg mt-4 border-gray-500 backdrop-blur',
as === 'main' &&
'mt-4 rounded-lg border-2 border-zinc-500 bg-zinc-100/70 dark:bg-zinc-900/70',
className
)}
ref={ref}
Expand Down

0 comments on commit 4bbad58

Please sign in to comment.