fix(SW-556): now fetching surprises separately in component.

also showing surprises on any account page
This commit is contained in:
Christian Andolf
2024-10-21 17:11:15 +02:00
parent 3508253afe
commit e6db1b17c6
11 changed files with 209 additions and 73 deletions

View File

@@ -1,4 +1,3 @@
import { getProfile } from "@/lib/trpc/memoizedRequests"
import { serverClient } from "@/lib/trpc/server"
import SectionContainer from "@/components/Section/Container"
@@ -23,19 +22,10 @@ export default async function CurrentRewardsBlock({
return null
}
const user = await getProfile()
if (!user || "error" in user) {
return null
}
return (
<SectionContainer>
<SectionHeader title={title} link={link} preamble={subtitle} />
<ClientCurrentRewards
initialCurrentRewards={initialCurrentRewards}
membershipNumber={user.membership?.membershipNumber}
/>
<ClientCurrentRewards initialCurrentRewards={initialCurrentRewards} />
<SectionLink link={link} variant="mobile" />
</SectionContainer>
)