Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Commit

Permalink
feat: add conditional pagination
Browse files Browse the repository at this point in the history
- only paginate the tiles when there is no search or category param
  • Loading branch information
tabathadelane committed Jul 27, 2022
1 parent fe4234b commit 2f7c9da
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,15 @@ const QuickstartsPage = ({ data, location }) => {
`}
>
{Boolean(search) && <SuperTiles />}
<QuickstartGrid quickstarts={filteredQuickstarts} />

{/* Add pagination grid if no search term or category selected */}
{Boolean(search) && Boolean(!category) ? (
filteredQuickstarts.map((pack) => (
<QuickstartTile key={pack.id} featured={false} {...pack} />
))
) : (
<QuickstartGrid quickstarts={filteredQuickstarts} />
)}
</div>
</div>
</div>
Expand Down

0 comments on commit 2f7c9da

Please sign in to comment.