fix: fetch 13 articles so Latest grid shows 12 after hero filter; hide Load More when all articles already loaded
This commit is contained in:
@@ -7,13 +7,14 @@ import ArticleCard from './ArticleCard'
|
||||
interface Props {
|
||||
categorySlug: string
|
||||
initialCount: number
|
||||
hasMore?: boolean
|
||||
}
|
||||
|
||||
export default function LoadMoreButton({ categorySlug, initialCount }: Props) {
|
||||
export default function LoadMoreButton({ categorySlug, initialCount, hasMore: initialHasMore = true }: Props) {
|
||||
const [articles, setArticles] = useState<Article[]>([])
|
||||
const [offset, setOffset] = useState(initialCount)
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [hasMore, setHasMore] = useState(true)
|
||||
const [hasMore, setHasMore] = useState(initialHasMore)
|
||||
|
||||
async function loadMore() {
|
||||
setLoading(true)
|
||||
|
||||
Reference in New Issue
Block a user