Repository navigation
Add form validation, providers, and onboarding hooks - #48
Conversation
| defaultValues: { | ||
| name: '', | ||
| email: '', | ||
| }, |
There was a problem hiding this comment.
default values can be a seperate object outside, to keep the code lean
| <input | ||
| id="name-input" | ||
| type="text" | ||
| value={name} | ||
| onChange={(e) => setName(e.target.value)} | ||
| {...register('name')} | ||
| onFocus={() => { | ||
| setState((s) => ({ ...s, focusedField: 'email' })) | ||
| sound.playPop(380) | ||
| }} | ||
| onBlur={() => setState((s) => ({ ...s, focusedField: 'none' }))} | ||
| placeholder="Your full name" | ||
| className="w-full px-3.5 py-2.5 rounded-xl border border-zinc-200 text-sm focus:outline-none focus:ring-2 focus:ring-zinc-900/10 focus:border-zinc-900 transition bg-zinc-50/50 hover:bg-zinc-50" | ||
| className="w-full px-3.5 py-2.5 rounded-xl border border-zinc-200 text-sm focus:outline-none focus:ring-2 focus:ring-zinc-900/10 focus:border-zinc-900 transition bg-zinc-50/50 hover:bg-zinc-50 text-zinc-900" | ||
| /> |
There was a problem hiding this comment.
lets use the shadcn input, also ig it has inbuilt support for react-hook-form iirc
| defaultValues: { | ||
| companyName: '', | ||
| companyMail: '', | ||
| companyUrl: '', | ||
| headquartersLocation: '', | ||
| }, |
|
|
||
| setTimeout(() => { | ||
| router.push('/landing') | ||
| }, 1400) |
There was a problem hiding this comment.
okay, what is the obsession with 1400? and can we have it as a constant var
There was a problem hiding this comment.
Not strictly necessary for functionality it was just added to let the confetti play before redirecting.
There was a problem hiding this comment.
yeah but the 1400 ms timer is weird, either it can be 1s or 2s, not sure how we came with 1400. wanted to know that
I saw 1400 in 4-5 places, if its a calculated number then it shld be written in constants, so it can be easier to share with others, if not we shld follow whole seconds to keep things simple
| spread: 80, | ||
| origin: { y: 0.6 }, | ||
| colors: ['#00C26D', '#34D399', '#6366F1', '#3B82F6'], | ||
| }) |
There was a problem hiding this comment.
saw the same thing above, we can make this a reusable util function, so we just call showConfetti() and we dont have to define the colors and all again.
Even the particleCount and spread are different from the above one, is it intended?
if yes we can just make the CONFETTI_COLORS a shared constant, and keep others same
| graduationYear: '2026', | ||
| gpa: '', | ||
| specialization: '', | ||
| skills: ['React', 'TypeScript', 'Next.js', 'Tailwind CSS'], |
There was a problem hiding this comment.
why is this hardcoded as default skills? we shld not, not everyone will be web dev, will create bad UX. and will overpopulate these skills for no reason
| @@ -216,7 +220,7 @@ export default function RecruiterOnboardingPage() { | |||
| <g transform="translate(102, 172)"> | |||
| <circle cx="9" cy="9" r="8" fill="var(--brand-green)" /> | |||
| <circle cx="9" cy="7" r="3.2" fill="#FFFFFF" /> | |||
| <path d="M 4,14 C 4,11 6.5,10 9,10 C 11.5,10 14,14 14,14 Z" fill="#FFFFFF" /> | |||
| <path d="M 4,14 C 4,11 6.5,10 9,10 C 11.5,10 14,11 14,14 Z" fill="#FFFFFF" /> | |||
| <rect x="24" y="4" width="65" height="4" rx="2" fill="#94A3B8" /> | |||
| <rect x="24" y="11" width="40" height="3" rx="1.5" fill="var(--border-muted)" /> | |||
| </g> | |||
There was a problem hiding this comment.
lets avoid hardcoded svgs, please use icon libraries, iirc lucide-icons comes with shadcn
| })} | ||
| onFocus={() => { | ||
| setState((s) => ({ ...s, focusedField: 'email' })) | ||
| sound.playPop(420) |
There was a problem hiding this comment.
whats 420 here? magic number, please put it in a constant, and why are we playing sounds?
There was a problem hiding this comment.
420 Hz is the pitch for the playful sound effect. I can pull it into a named constant or disable the sounds if you’d rather keep it silent!
|
| className={`w-full px-3.5 py-2.5 rounded-xl border text-sm text-zinc-900 placeholder:text-zinc-400 focus:outline-none transition bg-zinc-50/40 hover:bg-zinc-50 ${ | ||
| state.focusedField === 'email' | ||
| ? 'border-zinc-900 ring-2 ring-zinc-900/10 bg-white' | ||
| : 'border-zinc-200' |
There was a problem hiding this comment.
lets avoid ternaries, can u use classNames here from shadcn package?
Standardized state management, form handling, and validation across
apps/web.Changes
Providerscomponent for React Query and toast notifications.lib/env.tsfor validating required environment variables.