Refactor DualOptionSelector layout in BusinessForm component

This commit is contained in:
Pattadon 2024-10-17 15:21:14 +07:00
parent 7c2b42e116
commit e44774f1cd

View File

@ -222,25 +222,28 @@ const BusinessForm = ({
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormControl> <FormControl>
<DualOptionSelector <div className="flex space-x-5">
name="isInUS" <DualOptionSelector
label={ name="isInUS"
<>Is your company incorporated in the United States?</> label={
} <>
choice1="Yes" Is your company incorporated in the United States?
choice2="No" </>
handleFunction={(selectedValues: string) => { }
// setIsInUS; choice1="Yes"
field.onChange(selectedValues); choice2="No"
}} handleFunction={(selectedValues: string) => {
description={ // setIsInUS;
<> field.onChange(selectedValues);
Only companies that are incorporated or formed in the }}
US are eligible to raise via Reg CF. description={<></>}
</> value={field.value}
} />
value={field.value} <span className="text-[12px] text-neutral-500 self-center">
/> Only companies that are incorporated or formed in the US
are eligible to raise via Reg CF.
</span>
</div>
</FormControl> </FormControl>
<FormMessage /> <FormMessage />
</FormItem> </FormItem>
@ -254,25 +257,27 @@ const BusinessForm = ({
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormControl> <FormControl>
<DualOptionSelector <div className="flex space-x-5">
name="isForSale" <DualOptionSelector
value={field.value} name="isForSale"
label={ value={field.value}
<>Is your product available (for sale) in market?</> label={
} <>Is your product available (for sale) in market?</>
choice1="Yes" }
choice2="No" choice1="Yes"
handleFunction={(selectedValues: string) => { choice2="No"
// setIsForSale; handleFunction={(selectedValues: string) => {
field.onChange(selectedValues); // setIsForSale;
}} field.onChange(selectedValues);
description={ }}
<> description={
Only check this box if customers can access, use, or <>
buy your product today. Only check this box if customers can access, use, or
</> buy your product today.
} </>
/> }
/>
</div>
</FormControl> </FormControl>
<FormMessage /> <FormMessage />
</FormItem> </FormItem>
@ -286,22 +291,24 @@ const BusinessForm = ({
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormControl> <FormControl>
<DualOptionSelector <div className="flex space-x-5">
name="isGenerating" <DualOptionSelector
label={<>Is your company generating revenue?</>} name="isGenerating"
choice1="Yes" label={<>Is your company generating revenue?</>}
choice2="No" choice1="Yes"
value={field.value} choice2="No"
handleFunction={(selectedValues: string) => { value={field.value}
field.onChange(selectedValues); handleFunction={(selectedValues: string) => {
}} field.onChange(selectedValues);
description={ }}
<> description={
Only check this box if your company is making money. <>
Please elaborate on revenue below. Only check this box if your company is making money.
</> Please elaborate on revenue below.
} </>
/> }
/>
</div>
</FormControl> </FormControl>
<FormMessage /> <FormMessage />
</FormItem> </FormItem>