fix: hide redeem button with feature flag

This commit is contained in:
Christian Andolf
2024-12-05 16:12:37 +01:00
parent 7be90facd0
commit 1a4dddb3fe
3 changed files with 12 additions and 4 deletions

View File

@@ -18,6 +18,7 @@ import type { CurrentRewardsClientProps } from "@/types/components/myPages/myPag
export default function ClientCurrentRewards({ export default function ClientCurrentRewards({
initialCurrentRewards, initialCurrentRewards,
showRedeem,
}: CurrentRewardsClientProps) { }: CurrentRewardsClientProps) {
const lang = useLang() const lang = useLang()
const { data, isFetching, fetchNextPage, hasNextPage, isLoading } = const { data, isFetching, fetchNextPage, hasNextPage, isLoading } =
@@ -73,9 +74,11 @@ export default function ClientCurrentRewards({
{reward.label} {reward.label}
</Title> </Title>
</div> </div>
<div className={styles.btnContainer}> {showRedeem && (
<Redeem reward={reward} /> <div className={styles.btnContainer}>
</div> <Redeem reward={reward} />
</div>
)}
</article> </article>
))} ))}
</Grids.Stackable> </Grids.Stackable>

View File

@@ -1,3 +1,4 @@
import { env } from "@/env/server"
import { serverClient } from "@/lib/trpc/server" import { serverClient } from "@/lib/trpc/server"
import SectionContainer from "@/components/Section/Container" import SectionContainer from "@/components/Section/Container"
@@ -25,7 +26,10 @@ export default async function CurrentRewardsBlock({
return ( return (
<SectionContainer> <SectionContainer>
<SectionHeader title={title} link={link} preamble={subtitle} /> <SectionHeader title={title} link={link} preamble={subtitle} />
<ClientCurrentRewards initialCurrentRewards={initialCurrentRewards} /> <ClientCurrentRewards
initialCurrentRewards={initialCurrentRewards}
showRedeem={env.USE_NEW_REWARDS_ENDPOINT}
/>
<SectionLink link={link} variant="mobile" /> <SectionLink link={link} variant="mobile" />
</SectionContainer> </SectionContainer>
) )

View File

@@ -22,6 +22,7 @@ export type ContentProps = {
export interface CurrentRewardsClientProps { export interface CurrentRewardsClientProps {
initialCurrentRewards: { rewards: Reward[]; nextCursor: number | undefined } initialCurrentRewards: { rewards: Reward[]; nextCursor: number | undefined }
showRedeem: boolean
} }
export interface Redeem { export interface Redeem {