feat(LOY-53): CurrentRewards - replace show more functionality with pagination

This commit is contained in:
Chuma McPhoy
2024-12-02 21:11:53 +01:00
parent 9e42cf0f37
commit 28d4d752e9
11 changed files with 124 additions and 167 deletions

View File

@@ -14,12 +14,9 @@ export default async function CurrentRewardsBlock({
subtitle,
link,
}: AccountPageComponentProps) {
const initialCurrentRewards =
await serverClient().contentstack.rewards.current({
limit: 3,
})
const rewardsResponse = await serverClient().contentstack.rewards.current()
if (!initialCurrentRewards) {
if (!rewardsResponse?.rewards.length) {
return null
}
@@ -27,7 +24,8 @@ export default async function CurrentRewardsBlock({
<SectionContainer>
<SectionHeader title={title} link={link} preamble={subtitle} />
<ClientCurrentRewards
initialCurrentRewards={initialCurrentRewards}
rewards={rewardsResponse.rewards}
pageSize={6}
showRedeem={env.USE_NEW_REWARDS_ENDPOINT}
/>
<SectionLink link={link} variant="mobile" />