Skip to content

Commit e23e264

Browse files
committed
pass isWaitlistRedirectEnabled from server side
1 parent f78b26b commit e23e264

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

src/app/(marketing)/roadmap/page.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { GetRoadmapItemsResult } from '@/lib/RoadmapService';
44
import { AgentsmithServices } from '@/lib/AgentsmithServices';
55
import { AuthProvider } from '@/providers/auth';
66
import { Suspense } from 'react';
7+
import { IS_WAITLIST_REDIRECT_ENABLED } from '@/app/constants';
78

89
export const revalidate = 43200;
910

@@ -22,7 +23,10 @@ export default async function RoadmapServerPage() {
2223
return (
2324
<Suspense>
2425
<AuthProvider>
25-
<RoadmapPage initialRoadmapItems={initialRoadmapItems} />
26+
<RoadmapPage
27+
initialRoadmapItems={initialRoadmapItems}
28+
isWaitlistRedirectEnabled={IS_WAITLIST_REDIRECT_ENABLED}
29+
/>
2630
</AuthProvider>
2731
</Suspense>
2832
);

src/components/roadmap/propose-cta.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ import { toast } from 'sonner';
55
import { useAuth } from '@/providers/auth';
66
import { routes } from '@/utils/routes';
77
import { cn } from '@/utils/shadcn';
8-
import { IS_WAITLIST_REDIRECT_ENABLED } from '@/app/constants';
98

109
type RoadmapProposeCtaProps = {
1110
setIsProposeModalOpen: (isOpen: boolean) => void;
11+
isWaitlistRedirectEnabled: boolean;
1212
className?: string;
1313
};
1414

1515
export const RoadmapProposeCta = (props: RoadmapProposeCtaProps) => {
16-
const { setIsProposeModalOpen, className } = props;
16+
const { setIsProposeModalOpen, className, isWaitlistRedirectEnabled } = props;
1717
const { isLoading, agentsmithUser } = useAuth();
1818

1919
const currentUserId = agentsmithUser?.id;
20-
const isWaitlisted = agentsmithUser?.studio_access === false && IS_WAITLIST_REDIRECT_ENABLED;
20+
const isWaitlisted = agentsmithUser?.studio_access === false && isWaitlistRedirectEnabled;
2121

2222
return isLoading ? (
2323
<Button disabled className={cn('gap-0', className)}>

src/page-components/RoadmapPage.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ type FilterStatus = 'ALL' | RoadmapStatus;
3636

3737
type RoadmapPageProps = {
3838
initialRoadmapItems: GetRoadmapItemsResult;
39+
isWaitlistRedirectEnabled: boolean;
3940
};
4041

4142
export const RoadmapPage = (props: RoadmapPageProps) => {
42-
const { initialRoadmapItems } = props;
43+
const { initialRoadmapItems, isWaitlistRedirectEnabled } = props;
4344
const { agentsmithUser, isLoading: isAuthLoading } = useAuth();
4445
const searchParams = useSearchParams();
4546

@@ -230,7 +231,10 @@ export const RoadmapPage = (props: RoadmapPageProps) => {
230231
</p>
231232
</div>
232233

233-
<RoadmapProposeCta setIsProposeModalOpen={setIsProposeModalOpen} />
234+
<RoadmapProposeCta
235+
setIsProposeModalOpen={setIsProposeModalOpen}
236+
isWaitlistRedirectEnabled={isWaitlistRedirectEnabled}
237+
/>
234238
</div>
235239

236240
<div className="flex flex-col lg:flex-row justify-between items-start md:items-center gap-4 mb-8 rounded-md">
@@ -304,7 +308,10 @@ export const RoadmapPage = (props: RoadmapPageProps) => {
304308
<p className="text-muted-foreground mb-6">
305309
Try adjusting your filters or suggest a new feature.
306310
</p>
307-
<RoadmapProposeCta setIsProposeModalOpen={setIsProposeModalOpen} />
311+
<RoadmapProposeCta
312+
setIsProposeModalOpen={setIsProposeModalOpen}
313+
isWaitlistRedirectEnabled={isWaitlistRedirectEnabled}
314+
/>
308315
</div>
309316
)}
310317

0 commit comments

Comments
 (0)