feat(LOY-53): CurrentRewards - replace show more functionality with pagination
This commit is contained in:
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user