From 6d48c88f6c71932658dbd6c71b13ac04e05b5eef Mon Sep 17 00:00:00 2001 From: Jonas Daniels Date: Thu, 29 May 2025 17:36:33 -0700 Subject: [PATCH] [Dashboard] migrate op credits form to shadcn --- .../onboarding/ApplyForOpCreditsForm.tsx | 161 ++++++++++-------- 1 file changed, 88 insertions(+), 73 deletions(-) diff --git a/apps/dashboard/src/components/onboarding/ApplyForOpCreditsForm.tsx b/apps/dashboard/src/components/onboarding/ApplyForOpCreditsForm.tsx index b1d6ad4b05f..2e686f817cf 100644 --- a/apps/dashboard/src/components/onboarding/ApplyForOpCreditsForm.tsx +++ b/apps/dashboard/src/components/onboarding/ApplyForOpCreditsForm.tsx @@ -1,16 +1,22 @@ import type { Team } from "@/api/team"; +import { MultiSelect } from "@/components/blocks/multi-select"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; import { Textarea } from "@/components/ui/textarea"; import type { Account } from "@3rdweb-sdk/react/hooks/useApi"; -import { Flex, FormControl } from "@chakra-ui/react"; -import { Select as ChakraSelect } from "chakra-react-select"; import { useTrack } from "hooks/analytics/useTrack"; import { useLocalStorage } from "hooks/useLocalStorage"; import { useTxNotifications } from "hooks/useTxNotifications"; import { useMemo } from "react"; import { useForm } from "react-hook-form"; -import { FormHelperText, FormLabel } from "tw-components"; import { PlanToCreditsRecord } from "./ApplyForOpCreditsModal"; import { applyOpSponsorship } from "./applyOpSponsorship"; @@ -73,10 +79,8 @@ export const ApplyForOpCreditsForm: React.FC = ({ ); return ( - { const fields = Object.keys(data).map((key) => ({ name: key, @@ -127,67 +131,84 @@ export const ApplyForOpCreditsForm: React.FC = ({ } })} > - - - - First Name +
+
+
+ - - - Last Name +
+
+ - - +
+
- - Company Name +
+ - +
- - Company Website +
+ - URL should start with https:// - - - Company Social Account +

+ URL should start with https:// +

+
+
+ - URL should start with https:// - - - Industry - ({ - label: vertical, - value: - vertical === "Payments & Finance (DeFi)" ? "DeFi" : vertical, - }))} - placeholder="Select industry" - isRequired - onChange={(value) => { - if (value?.value) { - form.setValue("superchain_verticals", value.value); - } +

+ URL should start with https:// +

+
+
+ + +
+
+ + + form.setValue("superchain_chain", values.join(";")) + } options={[ "Optimism", "Base", @@ -208,27 +229,21 @@ export const ApplyForOpCreditsForm: React.FC = ({ label: chain === "Optimism" ? "OP Mainnet" : chain, value: chain, }))} - onChange={(values) => { - form.setValue( - "superchain_chain", - values.map(({ value }) => value).join(";"), - ); - }} - isMulti - selectedOptionStyle="check" placeholder="Select chains" - isRequired + className="w-full" /> - - - Tell us more about your project +
+
+