Skip to content

Commit

Permalink
페이지네이션 임시 제외
Browse files Browse the repository at this point in the history
  • Loading branch information
shinwonse committed Jun 4, 2024
1 parent a7ec063 commit 161cef2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
24 changes: 22 additions & 2 deletions src/app/(post)/posts/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import Link from 'next/link';

import Card from '@/app/components/Card';
import { getPosts } from '@/services/post';
import {
Pagination,
PaginationContent,
PaginationItem,
PaginationLink,
} from '@/components/ui/pagination';
import { getPaginatedPosts } from '@/services/post';
import { cn } from '@/utils/cn';

const Posts = async () => {
const posts = await getPosts();
const { posts } = await getPaginatedPosts();

return (
<main className={cn('flex w-full flex-col items-center px-6')}>
Expand All @@ -19,6 +25,20 @@ const Posts = async () => {
</li>
))}
</ul>
<Pagination>
<PaginationContent>
<PaginationItem>
<PaginationLink href="#" size="icon">
Previous
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink href="#" size="icon">
Next
</PaginationLink>
</PaginationItem>
</PaginationContent>
</Pagination>
</main>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/services/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const getAllPosts = async () => {
return response.results.map(processPost);
};

const PAGE_SIZE = 5;
const PAGE_SIZE = 10;

/**
* Get all posts from the Notion database with pagination
Expand Down

0 comments on commit 161cef2

Please sign in to comment.