11"use client" ;
22
3+ import { parseActionError } from "@/lib/actions/parse-action-errors" ;
34import { PartnerData } from "@/lib/actions/partners/create-program-application" ;
45import { onboardPartnerAction } from "@/lib/actions/partners/onboard-partner" ;
56import { onboardPartnerSchema } from "@/lib/zod/schemas/partners" ;
67import { CountryCombobox } from "@/ui/partners/country-combobox" ;
78import { Partner } from "@dub/prisma/client" ;
89import {
910 Button ,
10- buttonVariants ,
1111 FileUpload ,
1212 ToggleGroup ,
1313 TooltipContent ,
1414 useEnterSubmit ,
1515 useLocalStorage ,
1616 useMediaQuery ,
1717} from "@dub/ui" ;
18- import { cn } from "@dub/utils/src/functions " ;
18+ import { cn } from "@dub/utils" ;
1919import { AnimatePresence , LayoutGroup , motion } from "motion/react" ;
2020import { useSession } from "next-auth/react" ;
2121import { useAction } from "next-safe-action/hooks" ;
@@ -96,7 +96,7 @@ export function OnboardingForm({
9696 router . push ( "/onboarding/platforms" ) ;
9797 } ,
9898 onError : ( { error, input } ) => {
99- toast . error ( error . serverError ) ;
99+ toast . error ( parseActionError ( error , "An unknown error occurred." ) ) ;
100100 reset ( input ) ;
101101 } ,
102102 } ) ;
@@ -111,7 +111,7 @@ export function OnboardingForm({
111111 className = "flex w-full flex-col gap-6 text-left"
112112 >
113113 < label >
114- < span className = "text-sm font-medium text-neutral-800" > Full Name</ span >
114+ < span className = "text-sm font-medium text-neutral-800" > Name</ span >
115115 < input
116116 type = "text"
117117 className = { cn (
@@ -129,22 +129,18 @@ export function OnboardingForm({
129129
130130 < label >
131131 < span className = "text-sm font-medium text-neutral-800" >
132- Profile Image
132+ Profile image
133133 </ span >
134134 < div className = "flex items-center gap-5" >
135135 < Controller
136136 control = { control }
137137 name = "image"
138- rules = { { required : true } }
139138 render = { ( { field } ) => (
140139 < FileUpload
141140 accept = "images"
142- className = { cn (
143- "mt-1.5 size-20 rounded-full border border-neutral-300" ,
144- errors . image && "border-0 ring-2 ring-red-500" ,
145- ) }
141+ className = "mt-1.5 size-20 rounded-full border border-neutral-300"
146142 iconClassName = "size-5"
147- previewClassName = "size-10 rounded-full"
143+ previewClassName = "size-20 rounded-full"
148144 variant = "plain"
149145 imageSrc = { field . value }
150146 readFile
@@ -156,16 +152,11 @@ export function OnboardingForm({
156152 ) }
157153 />
158154 < div >
159- < div
160- className = { cn (
161- buttonVariants ( { variant : "secondary" } ) ,
162- "flex h-7 w-fit cursor-pointer items-center rounded-md border px-2 text-xs" ,
163- ) }
164- >
165- Upload image
166- </ div >
167- < p className = "mt-1.5 text-xs text-neutral-500" >
168- Recommended size: 160x160px
155+ < p className = "text-xs text-neutral-500" >
156+ Square image recommended, up to 2 MB.
157+ </ p >
158+ < p className = "mt-0.5 text-xs font-medium text-neutral-500" >
159+ Adding an image can improve your approval rates.
169160 </ p >
170161 </ div >
171162 </ div >
0 commit comments