Implement waitlist landing page FRE-656
- Add waitlist tRPC router with signup mutation and count query - Add referral code generation and tracking - Register waitlist router in app router - Add useWaitlistSignup, useWaitlistCount, useReferralCount hooks - Update landing page with email capture form, live waitlist counter, referral sharing - Add waitlist and referral CSS styles Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -324,3 +324,32 @@ export function useDeleteScene() {
|
||||
},
|
||||
}));
|
||||
}
|
||||
|
||||
// Waitlist hooks
|
||||
export function useWaitlistSignup() {
|
||||
return createMutation(() => ({
|
||||
mutationFn: async (input: { email: string; name?: string; source?: string; referralCode?: string }) => {
|
||||
return await trpc.waitlist.signup.mutate(input);
|
||||
},
|
||||
}));
|
||||
}
|
||||
|
||||
export function useWaitlistCount() {
|
||||
return createQuery(() => ({
|
||||
queryKey: ['waitlistCount'],
|
||||
queryFn: async () => {
|
||||
return await trpc.waitlist.getCount.query(undefined);
|
||||
},
|
||||
refetchInterval: 30000,
|
||||
}));
|
||||
}
|
||||
|
||||
export function useReferralCount(referralCode: string) {
|
||||
return createQuery(() => ({
|
||||
queryKey: ['referralCount', referralCode],
|
||||
queryFn: async () => {
|
||||
return await trpc.waitlist.getReferralCount.query({ referralCode });
|
||||
},
|
||||
enabled: !!referralCode,
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user