Skip to content

Commit

Permalink
chore: test
Browse files Browse the repository at this point in the history
  • Loading branch information
kyechan99 committed Oct 12, 2024
1 parent b9faaca commit daea909
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
16 changes: 12 additions & 4 deletions apps/www/src/app/[...slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '@/styles/prism.css';
import { notFound } from 'next/navigation';

import { PostLayout } from '@/components/layout';
// import { notFound } from 'next/navigation';
// import { PostLayout } from '@/components/layout';
import { allPosts } from '@/constants/posts';
import { PostType } from '@/types/post';
import { getArticleMetadata } from '@/utils/seo';
Expand All @@ -18,10 +18,18 @@ export const generateMetadata = ({ params }: { params: { slug: string[] } }) =>

const PostPage = ({ params }: { params: { slug: string[] } }) => {
const flattenedPath = params.slug.join('/');
console.log(flattenedPath);
const post = allPosts.find(post => post._raw.flattenedPath === flattenedPath);
if (!post) notFound();
return (
<div>
{flattenedPath}
<hr />
{JSON.stringify(post)}
</div>
);
// if (!post) notFound();

return <PostLayout post={post} />;
// return <PostLayout post={post} />;
};

export default PostPage;
1 change: 0 additions & 1 deletion apps/www/src/recoil/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const openSidebarState = selector({
return get(openSidebarAtom);
},
set: ({ set }, newVal) => {
console.log(newVal);
if (newVal) {
document.body.classList.toggle('hidden', true);
const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
Expand Down

0 comments on commit daea909

Please sign in to comment.