feat: implement multi-step community signup flow with validation and API integration#21
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the SignUpPage into a comprehensive multi-step form utilizing react-hook-form and zod for validation. It introduces a modular architecture with dedicated components for each step, a custom hook for form logic, and an API utility for handling submissions and logo uploads. Review feedback suggests improving code maintainability by replacing hardcoded magic numbers—specifically the post-state transition timeout and the file size limit—with constants, and adopting the best practice of throwing Error instances instead of plain objects in the API layer.
| useEffect(() => { | ||
| if (post !== "email") return; | ||
| const id = setTimeout(() => setPost("pending"), 3500); | ||
| return () => clearTimeout(id); | ||
| }, [post]); |
| if (!res.ok) { | ||
| throw { status: res.status, data: json }; | ||
| } |
There was a problem hiding this comment.
The error handling logic throws a plain object. It is better practice to throw an Error instance or a custom error class to maintain a consistent error stack trace.
| if (!res.ok) { | |
| throw { status: res.status, data: json }; | |
| } | |
| if (!res.ok) { | |
| throw new Error(json.message || "Signup failed"); | |
| } |
| if (file.size > 2 * 1024 * 1024) { | ||
| setUploadError("File must be under 2MB."); | ||
| if (fileRef.current) fileRef.current.value = ""; | ||
| return; | ||
| } |
|
@Pranavkale11 fix these issue that Gemini suggest you |




#2
Overview
This PR implements a multi-step community signup flow aligned with the backend schema.
The goal was to create a smooth, user-friendly onboarding experience while keeping the implementation scalable and production-ready.
Features
Fixes & Improvements
Testing
Notes