fix: load more button overflow
This commit is contained in:
@@ -145,22 +145,24 @@ export default function PostList({
|
||||
</div>
|
||||
)}
|
||||
{posts.hasNextPage && (
|
||||
<Button
|
||||
className="mt-8 mx-auto !flex"
|
||||
variant="outline"
|
||||
onClick={() => posts.fetchNextPage()}
|
||||
isLoading={posts.isFetchingNextPage}
|
||||
aria-label="load more"
|
||||
>
|
||||
{t("load more", {
|
||||
ns: "site",
|
||||
name: t(
|
||||
"post" +
|
||||
(posts.data?.pages[0].count - currentLength > 1 ? "s" : ""),
|
||||
),
|
||||
count: posts.data?.pages[0].count - currentLength,
|
||||
})}
|
||||
</Button>
|
||||
<div className="text-center">
|
||||
<Button
|
||||
className="mt-8 truncate max-w-full !inline-block"
|
||||
variant="outline"
|
||||
onClick={() => posts.fetchNextPage()}
|
||||
isLoading={posts.isFetchingNextPage}
|
||||
aria-label="load more"
|
||||
>
|
||||
{t("load more", {
|
||||
ns: "site",
|
||||
name: t(
|
||||
"post" +
|
||||
(posts.data?.pages[0].count - currentLength > 1 ? "s" : ""),
|
||||
),
|
||||
count: posts.data?.pages[0].count - currentLength,
|
||||
})}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -145,17 +145,20 @@ export const SiteArchives = () => {
|
||||
)
|
||||
})}
|
||||
{posts.hasNextPage && (
|
||||
<Button
|
||||
className="mt-8 mx-auto !flex"
|
||||
variant="outline"
|
||||
onClick={() => posts.fetchNextPage()}
|
||||
isLoading={posts.isFetchingNextPage}
|
||||
aria-label="load more"
|
||||
>
|
||||
There are {posts.data?.pages[0].count - currentLength} more post
|
||||
{posts.data?.pages[0].count - currentLength > 1 ? "s" : ""},
|
||||
click to load more
|
||||
</Button>
|
||||
<div className="text-center">
|
||||
<Button
|
||||
className="mt-8 truncate max-w-full !inline-block"
|
||||
variant="outline"
|
||||
onClick={() => posts.fetchNextPage()}
|
||||
isLoading={posts.isFetchingNextPage}
|
||||
aria-label="load more"
|
||||
>
|
||||
There are {posts.data?.pages[0].count - currentLength} more
|
||||
post
|
||||
{posts.data?.pages[0].count - currentLength > 1 ? "s" : ""},
|
||||
click to load more
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user