🔐 Split Combined Login/Signup Modal into Separate Components
Description
Currently, the login and signup functionality is combined into a single LoginModal.tsx component that toggles between modes using an internal isSignup state. This creates a tightly coupled component that handles multiple responsibilities. Split this into separate, focused components and let the header determine whether to show the login or signup form in the popover content.
Current Implementation Issues
- Single component handles both login and signup logic
- Internal state switching between modes creates complexity
- Header has no control over which form to display initially
- Difficult to maintain and extend with additional auth flows
Proposed Components Structure
LoginForm.tsx - Dedicated login component
SignupForm.tsx - Dedicated signup component
AuthModal.tsx - Wrapper component that renders the appropriate form based on props
- Header controls which auth mode to display via props
Tasks
-
Create separate LoginForm component
- Extract login-specific fields (email, password)
- Include "Remember me" checkbox
- Include "Forgot Password" link
- Handle login submission and validation
- Maintain existing styling and UX
-
Create separate SignupForm component
- Extract signup-specific fields (email, username, password)
- Handle signup submission and validation
- Include terms/policy acceptance if needed
- Maintain existing styling and UX
-
Create AuthModal wrapper component
- Accept
mode prop ('login' | 'signup')
- Render appropriate form based on mode
- Handle modal close functionality
- Maintain common modal styling and structure
-
Update Header component
- Add state to track desired auth mode
- Keep current "Login / Sign up" button trigger
- Pass mode prop to AuthModal
- Update popover content to use new AuthModal
-
Add cross-navigation between forms
- Login form includes "Sign up" link that switches to signup mode
- Signup form includes "Login" link that switches to login mode
- Modal stays open during mode transitions
- Smooth UX transition between forms
-
Preserve existing functionality
- Google OAuth integration
- Error handling and display
- Loading states
- Form validation
- Success/redirect behavior
- Modal close on outside interaction prevention
Acceptance Criteria
- Login and signup are separate, focused components
- Header can control which auth form to display via mode state
- Modal stays open when switching between login and signup modes
- Smooth navigation between authentication modes within the same modal
- All existing functionality is preserved (OAuth, validation, error handling)
- Components are reusable and can be used independently
- Clean separation of concerns between authentication modes
- Existing styling and UX patterns are maintained
- Current "Login / Sign up" button behavior is preserved
- No breaking changes to authentication flow
🔐 Split Combined Login/Signup Modal into Separate Components
Description
Currently, the login and signup functionality is combined into a single
LoginModal.tsxcomponent that toggles between modes using an internalisSignupstate. This creates a tightly coupled component that handles multiple responsibilities. Split this into separate, focused components and let the header determine whether to show the login or signup form in the popover content.Current Implementation Issues
Proposed Components Structure
LoginForm.tsx- Dedicated login componentSignupForm.tsx- Dedicated signup componentAuthModal.tsx- Wrapper component that renders the appropriate form based on propsTasks
Create separate LoginForm component
Create separate SignupForm component
Create AuthModal wrapper component
modeprop ('login' | 'signup')Update Header component
Add cross-navigation between forms
Preserve existing functionality
Acceptance Criteria