@@ -24,7 +24,6 @@ import { CurrencySelector } from '../../CurrencySelector'
2424import { SUPPORTED_PAYOUT_COUNTRIES } from './config/supported-payout-countries'
2525import { useOnboardingData } from './OnboardingContext'
2626import { OnboardingShell } from './OnboardingShell'
27- import { ORGANIZATION_MIN_LENGTH } from './validation'
2827
2928interface FormSchema {
3029 organizationType : 'individual' | 'company'
@@ -208,12 +207,13 @@ function CurrencyAndCountryFields() {
208207function SubmitButton ( { loading } : { loading : boolean } ) {
209208 const orgName = useWatch < FormSchema , 'orgName' > ( { name : 'orgName' } )
210209 const orgSlug = useWatch < FormSchema , 'orgSlug' > ( { name : 'orgSlug' } )
211- const isDisabled =
212- orgName . length < ORGANIZATION_MIN_LENGTH ||
213- orgSlug . length < ORGANIZATION_MIN_LENGTH
214-
215210 return (
216- < Button type = "submit" loading = { loading } disabled = { isDisabled } fullWidth >
211+ < Button
212+ type = "submit"
213+ loading = { loading }
214+ disabled = { orgName . length === 0 || orgSlug . length === 0 }
215+ fullWidth
216+ >
217217 Continue
218218 </ Button >
219219 )
@@ -325,13 +325,7 @@ export function BusinessDetailsStep() {
325325 < FormField
326326 control = { form . control }
327327 name = "orgName"
328- rules = { {
329- required : 'Organization name is required' ,
330- minLength : {
331- value : ORGANIZATION_MIN_LENGTH ,
332- message : `Organization name must be at least ${ ORGANIZATION_MIN_LENGTH } characters` ,
333- } ,
334- } }
328+ rules = { { required : 'Organization name is required' } }
335329 render = { ( { field } ) => (
336330 < FormItem className = "w-full" >
337331 < FormLabel > Organization Name</ FormLabel >
@@ -346,13 +340,7 @@ export function BusinessDetailsStep() {
346340 < FormField
347341 control = { form . control }
348342 name = "orgSlug"
349- rules = { {
350- required : 'Organization slug is required' ,
351- minLength : {
352- value : ORGANIZATION_MIN_LENGTH ,
353- message : `Organization slug must be at least ${ ORGANIZATION_MIN_LENGTH } characters` ,
354- } ,
355- } }
343+ rules = { { required : 'Slug is required' } }
356344 render = { ( { field } ) => (
357345 < FormItem className = "w-full" >
358346 < FormLabel > Organization Slug</ FormLabel >
0 commit comments