Skip to content

Commit

Permalink
[fix] state effect
Browse files Browse the repository at this point in the history
  • Loading branch information
lowk3v committed Jan 5, 2024
1 parent 7d46947 commit 3909e3d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"favicon": "/images/avatar.png"
},
"settings": {
"pagination": 5,
"pagination": 6,
"summary_length": 200,
"blog_folder": "posts"
},
Expand Down
4 changes: 2 additions & 2 deletions layouts/components/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const Report = ({ post, className }) => {
className="btn-link inline-flex items-center hover:text-primary"
href={post.frontmatter.url || ''} target='_blank'
>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" className="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z" />
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" className="w-6 h-6">
<path d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z" />
</svg>
</Link>
</div>
Expand Down
5 changes: 3 additions & 2 deletions pages/page/[slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const BlogPagination = ({ posts, currentPage, pagination }) => {
},
}).then((res) => {
res.json().then((data) => {
const sortedPosts = data.feeds.concat(allPosts).sort((a, b) => {
const sortedPosts = data.feeds.concat(posts).sort((a, b) => {
return new Date(b.pubDate ? b.pubDate : b.frontmatter.date)
- new Date(a.pubDate ? a.pubDate : a.frontmatter.date)
})
Expand All @@ -34,9 +34,10 @@ const BlogPagination = ({ posts, currentPage, pagination }) => {
)
setTotalPages(Math.ceil(sortedPosts.length / pagination))
setIsFeeding(false)
console.log(sortedPosts.slice(indexOfFirstPost, indexOfLastPost))
})
})
}, []);
}, [currentPage, posts]);

return (
<div className="section container">
Expand Down

0 comments on commit 3909e3d

Please sign in to comment.