From d3835bd67f465a80dbd18aba568d53aeac0db514 Mon Sep 17 00:00:00 2001 From: Matthew Russell Date: Mon, 18 Sep 2023 22:17:42 -0700 Subject: [PATCH] feat: add ui to handle code creation and stake requirements --- .../referrals/apply-code-form.tsx | 6 +- .../referrals/create-code-form.tsx | 225 ++++++++++++++---- .../referrals/hooks/use-referral-program.ts | 7 +- .../client-pages/referrals/referrals.tsx | 3 + apps/trading/pages/client-router.tsx | 6 +- libs/environment/src/hooks/use-links.ts | 1 + 6 files changed, 197 insertions(+), 51 deletions(-) diff --git a/apps/trading/client-pages/referrals/apply-code-form.tsx b/apps/trading/client-pages/referrals/apply-code-form.tsx index dba8821b7..f735e611c 100644 --- a/apps/trading/client-pages/referrals/apply-code-form.tsx +++ b/apps/trading/client-pages/referrals/apply-code-form.tsx @@ -16,8 +16,8 @@ export const ApplyCodeForm = () => { setValue, setError, } = useForm(); - const [params] = useSearchParams(); + useEffect(() => { const code = params.get('code'); if (code) setValue('code', code); @@ -46,7 +46,7 @@ export const ApplyCodeForm = () => { return (
-

+

Apply a referral code

Enter a referral code

@@ -57,7 +57,7 @@ export const ApplyCodeForm = () => { onSubmit={handleSubmit(onSubmit)} >