Skip to content

Fix signup category visibility and alignment issue#322

Merged
Sachinchaurasiya360 merged 1 commit into
Sachinchaurasiya360:mainfrom
Darshan200531:fix-signup-category-alignment
May 21, 2026
Merged

Fix signup category visibility and alignment issue#322
Sachinchaurasiya360 merged 1 commit into
Sachinchaurasiya360:mainfrom
Darshan200531:fix-signup-category-alignment

Conversation

@Darshan200531
Copy link
Copy Markdown

@Darshan200531 Darshan200531 commented May 18, 2026

Changes Made

  • Fixed signup category alignment issue
  • Improved responsiveness for different screen sizes
  • Corrected spacing and visibility problems

Summary by CodeRabbit

  • New Features

    • Added role selection (Student/Recruiter) during login and registration with role-specific customization.
    • Google OAuth sign-in now includes role information.
  • Improvements

    • Email field labels and promotional content now adapt based on selected user role.
  • Bug Fixes

    • Enhanced Google OAuth configuration fallback handling.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

📝 Walkthrough

Walkthrough

The PR consolidates recruiter-specific authentication into unified login/register pages. Recruiter routes now redirect with a role=RECRUITER query parameter, the login form reads and manages role state via UI controls, role-aware labels update dynamically, Google sign-in receives the selected role, and the promo panel renders student or recruiter content based on the active role.

Changes

Unified Auth with Role Selection

Layer / File(s) Summary
Route Consolidation and Redirects
client/src/App.tsx
Recruiter-specific auth page lazy imports removed; /recruiter/login and /recruiter/register routes replaced with Navigate redirects to /login?role=RECRUITER and /register?role=RECRUITER.
Role State Initialization and Google Sign-In
client/src/module/auth/LoginPage.tsx
LoginPage reads role query parameter to initialize state (STUDENT or RECRUITER), derives isRecruiter boolean flag, and updates Google sign-in handler to include selected role in request payload.
Role Selector and Role-Dependent Form Fields
client/src/module/auth/LoginPage.tsx
Adds role selection buttons (Student/Recruiter) with updated Google sign-in button label, email field label/placeholder vary by role (company vs personal), and sign-up link preserves from and includes role in query string.
Promo Panel Role-Based Content
client/src/module/auth/LoginPage.tsx
AuthPromoPanel refactored to accept isRecruiter flag instead of separate content props; conditionally renders student or recruiter stats, headers, and footer text using keyed animated elements.
Supporting Fixes
client/src/main.tsx, client/src/module/recruiter/auth/RecruiterLoginPage.tsx
Google OAuth client ID fallback changed to 'missing_client_id' instead of empty string; recruiter login page "Forgot Password?" text capitalized.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

good first issue, level:beginner

Poem

🐰 Roles now unified, one path to login true,
Recruiter or student, the choice falls to you,
No duplicate pages, just role query flows,
Where promo content dances as the selection goes!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title describes a UI alignment issue, but the changeset primarily refactors authentication flows to unify recruiter and student login/registration routes, replacing dedicated recruiter pages with role-based parameters. Update the title to reflect the main change: something like 'Unify recruiter and student authentication flows with role-based routing' would better represent the core refactoring.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
client/src/main.tsx (1)

12-12: 💤 Low value

Consider removing the type assertion for better type safety.

The as string assertion is imprecise because import.meta.env.VITE_GOOGLE_CLIENT_ID could be undefined. While the || fallback handles this correctly at runtime, the assertion masks the actual type and could lead to confusion during maintenance.

♻️ Optional type-safe alternative
-const googleClientId = import.meta.env.VITE_GOOGLE_CLIENT_ID as string || 'missing_client_id'
+const googleClientId = import.meta.env.VITE_GOOGLE_CLIENT_ID || 'missing_client_id'

TypeScript will infer the correct type (string) from the fallback without the assertion.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/src/main.tsx` at line 12, The declaration of googleClientId uses a
type assertion ("as string") that hides the actual possibly-undefined type of
import.meta.env.VITE_GOOGLE_CLIENT_ID; remove the "as string" assertion and
either rely on TypeScript's type inference from the fallback or explicitly
annotate the constant as a string (i.e., update the googleClientId declaration)
so the code reflects the runtime fallback and preserves correct typing without
masking undefined.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@client/src/module/auth/LoginPage.tsx`:
- Around line 117-137: Replace the two raw <button> elements with the shared
Button component (Button) and keep the existing onClick handlers
(setRole("STUDENT") / setRole("RECRUITER")) and role-based styling by mapping
the current conditional classes into the Button's variant/size props and/or
className prop; add the Button import and ensure the "selected" state uses the
same bg/text classes when role === "STUDENT"/"RECRUITER" and preserve the
left-border for the second button via className (e.g., border-l styling) so
behavior and visuals match the original.
- Around line 14-15: Replace the native <button> usage in LoginPage with the
reusable Button component (import Button from
client/src/components/ui/button.tsx) and apply the appropriate variant/props
used elsewhere in the app; locate the buttons in the LoginPage render (the
elements controlling role selection and submission) and swap them to use Button
while preserving onClick handlers and accessibility attributes. Also ensure role
state (initialRole, role, setRole) stays in sync with the URL by adding a
useEffect in LoginPage that reads searchParams.get("role") and calls setRole
when the query param changes so the component and API payload reflect the
current URL.

---

Nitpick comments:
In `@client/src/main.tsx`:
- Line 12: The declaration of googleClientId uses a type assertion ("as string")
that hides the actual possibly-undefined type of
import.meta.env.VITE_GOOGLE_CLIENT_ID; remove the "as string" assertion and
either rely on TypeScript's type inference from the fallback or explicitly
annotate the constant as a string (i.e., update the googleClientId declaration)
so the code reflects the runtime fallback and preserves correct typing without
masking undefined.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: aaeffd8f-201f-4fbe-8691-04957dc6dc23

📥 Commits

Reviewing files that changed from the base of the PR and between 3552efa and 268b8a4.

⛔ Files ignored due to path filters (1)
  • client/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • client/src/App.tsx
  • client/src/main.tsx
  • client/src/module/auth/LoginPage.tsx
  • client/src/module/recruiter/auth/RecruiterLoginPage.tsx

Comment on lines +14 to +15
const initialRole = searchParams.get("role") === "RECRUITER" ? "RECRUITER" : "STUDENT";
const [role, setRole] = useState<"STUDENT" | "RECRUITER">(initialRole);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether query-param role is synchronized after initialization.
rg -n 'roleFromQuery|initialRole|useState<"STUDENT" \| "RECRUITER">|useEffect\(' client/src/module/auth/LoginPage.tsx

Repository: Sachinchaurasiya360/InternHack

Length of output: 244


🏁 Script executed:

# Get the full LoginPage component to understand role usage and routing context
head -200 client/src/module/auth/LoginPage.tsx | cat -n

Repository: Sachinchaurasiya360/InternHack

Length of output: 10240


🏁 Script executed:

# Check how searchParams is imported/used and if it's reactive
rg -B5 -A5 'searchParams' client/src/module/auth/LoginPage.tsx

Repository: Sachinchaurasiya360/InternHack

Length of output: 726


🏁 Script executed:

# Check if there are similar patterns in the codebase for syncing query params with state
rg -A10 'useEffect.*searchParams|useEffect.*query' client/src --type tsx | head -50

Repository: Sachinchaurasiya360/InternHack

Length of output: 102


Replace native buttons with the reusable Button component per coding guidelines.

Lines 117–136 use native <button> elements instead of the Button component from client/src/components/ui/button.tsx. Per guidelines, all new buttons must use the reusable Button component with proper variants/modes.

Additionally, consider syncing the role state when the role query param changes. Currently useState(initialRole) only captures the initial value; if the URL param changes while the component stays mounted, the state and API payload can drift from the URL. Add a useEffect hook to sync state to the query param.

Suggested fixes

Replace the native buttons with the Button component:

-                <button
-                  type="button"
-                  onClick={() => setRole("STUDENT")}
-                  className={`py-2.5 text-sm font-bold transition-colors border-0 cursor-pointer ${role === "STUDENT"
-                    ? "bg-lime-400 text-stone-950"
-                    : "bg-white dark:bg-stone-900 text-stone-600 dark:text-stone-400 hover:text-stone-900 dark:hover:text-stone-50"
-                    }`}
-                >
-                  Student
-                </button>
-                <button
-                  type="button"
-                  onClick={() => setRole("RECRUITER")}
-                  className={`py-2.5 text-sm font-bold transition-colors border-0 cursor-pointer border-l border-stone-300 dark:border-white/10 ${role === "RECRUITER"
-                    ? "bg-lime-400 text-stone-950"
-                    : "bg-white dark:bg-stone-900 text-stone-600 dark:text-stone-400 hover:text-stone-900 dark:hover:text-stone-50"
-                    }`}
-                >
-                  Recruiter
-                </button>
+                <Button variant={role === "STUDENT" ? "primary" : "secondary"} onClick={() => setRole("STUDENT")} className="text-sm font-bold">Student</Button>
+                <Button variant={role === "RECRUITER" ? "primary" : "secondary"} onClick={() => setRole("RECRUITER")} className="text-sm font-bold">Recruiter</Button>

Optionally, sync role state with query param:

-import { useState } from "react";
+import { useEffect, useState } from "react";
...
-  const initialRole = searchParams.get("role") === "RECRUITER" ? "RECRUITER" : "STUDENT";
-  const [role, setRole] = useState<"STUDENT" | "RECRUITER">(initialRole);
+  const roleFromQuery = searchParams.get("role") === "RECRUITER" ? "RECRUITER" : "STUDENT";
+  const [role, setRole] = useState<"STUDENT" | "RECRUITER">(roleFromQuery);
+
+  useEffect(() => {
+    setRole(roleFromQuery);
+  }, [roleFromQuery]);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/src/module/auth/LoginPage.tsx` around lines 14 - 15, Replace the
native <button> usage in LoginPage with the reusable Button component (import
Button from client/src/components/ui/button.tsx) and apply the appropriate
variant/props used elsewhere in the app; locate the buttons in the LoginPage
render (the elements controlling role selection and submission) and swap them to
use Button while preserving onClick handlers and accessibility attributes. Also
ensure role state (initialRole, role, setRole) stays in sync with the URL by
adding a useEffect in LoginPage that reads searchParams.get("role") and calls
setRole when the query param changes so the component and API payload reflect
the current URL.

Comment on lines +117 to +137
<button
type="button"
onClick={() => setRole("STUDENT")}
className={`py-2.5 text-sm font-bold transition-colors border-0 cursor-pointer ${role === "STUDENT"
? "bg-lime-400 text-stone-950"
: "bg-white dark:bg-stone-900 text-stone-600 dark:text-stone-400 hover:text-stone-900 dark:hover:text-stone-50"
}`}
>
Student
</button>
<button
type="button"
onClick={() => setRole("RECRUITER")}
className={`py-2.5 text-sm font-bold transition-colors border-0 cursor-pointer border-l border-stone-300 dark:border-white/10 ${role === "RECRUITER"
? "bg-lime-400 text-stone-950"
: "bg-white dark:bg-stone-900 text-stone-600 dark:text-stone-400 hover:text-stone-900 dark:hover:text-stone-50"
}`}
>
Recruiter
</button>
</div>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Use the shared Button component for the new role toggle controls.

These are newly added buttons in a TSX file, so they should use the reusable Button component to keep behavior/styles consistent.

Refactor sketch
+import { Button } from "../../components/ui/button";
...
-                <button
+                <Button
                   type="button"
                   onClick={() => setRole("STUDENT")}
-                  className={`py-2.5 text-sm font-bold transition-colors border-0 cursor-pointer ${role === "STUDENT"
-                    ? "bg-lime-400 text-stone-950"
-                    : "bg-white dark:bg-stone-900 text-stone-600 dark:text-stone-400 hover:text-stone-900 dark:hover:text-stone-50"
-                    }`}
+                  variant={role === "STUDENT" ? "primary" : "secondary"}
+                  size="md"
+                  aria-pressed={role === "STUDENT"}
+                  className="rounded-none border-0"
                 >
                   Student
-                </button>
-                <button
+                </Button>
+                <Button
                   type="button"
                   onClick={() => setRole("RECRUITER")}
-                  className={`py-2.5 text-sm font-bold transition-colors border-0 cursor-pointer border-l border-stone-300 dark:border-white/10 ${role === "RECRUITER"
-                    ? "bg-lime-400 text-stone-950"
-                    : "bg-white dark:bg-stone-900 text-stone-600 dark:text-stone-400 hover:text-stone-900 dark:hover:text-stone-50"
-                    }`}
+                  variant={role === "RECRUITER" ? "primary" : "secondary"}
+                  size="md"
+                  aria-pressed={role === "RECRUITER"}
+                  className="rounded-none border-0 border-l border-stone-300 dark:border-white/10"
                 >
                   Recruiter
-                </button>
+                </Button>

As per coding guidelines, client/src/**/*.tsx: Use the reusable Button component from client/src/components/ui/button.tsx for all new buttons with variants/modes/sizes.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<button
type="button"
onClick={() => setRole("STUDENT")}
className={`py-2.5 text-sm font-bold transition-colors border-0 cursor-pointer ${role === "STUDENT"
? "bg-lime-400 text-stone-950"
: "bg-white dark:bg-stone-900 text-stone-600 dark:text-stone-400 hover:text-stone-900 dark:hover:text-stone-50"
}`}
>
Student
</button>
<button
type="button"
onClick={() => setRole("RECRUITER")}
className={`py-2.5 text-sm font-bold transition-colors border-0 cursor-pointer border-l border-stone-300 dark:border-white/10 ${role === "RECRUITER"
? "bg-lime-400 text-stone-950"
: "bg-white dark:bg-stone-900 text-stone-600 dark:text-stone-400 hover:text-stone-900 dark:hover:text-stone-50"
}`}
>
Recruiter
</button>
</div>
<Button
onClick={() => setRole("STUDENT")}
variant={role === "STUDENT" ? "primary" : "secondary"}
size="md"
aria-pressed={role === "STUDENT"}
className="rounded-none border-0"
>
Student
</Button>
<Button
onClick={() => setRole("RECRUITER")}
variant={role === "RECRUITER" ? "primary" : "secondary"}
size="md"
aria-pressed={role === "RECRUITER"}
className="rounded-none border-0 border-l border-stone-300 dark:border-white/10"
>
Recruiter
</Button>
</div>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/src/module/auth/LoginPage.tsx` around lines 117 - 137, Replace the two
raw <button> elements with the shared Button component (Button) and keep the
existing onClick handlers (setRole("STUDENT") / setRole("RECRUITER")) and
role-based styling by mapping the current conditional classes into the Button's
variant/size props and/or className prop; add the Button import and ensure the
"selected" state uses the same bg/text classes when role ===
"STUDENT"/"RECRUITER" and preserve the left-border for the second button via
className (e.g., border-l styling) so behavior and visuals match the original.

@Abfa41 Abfa41 added good first issue Good for newcomers level:beginner Good for first-time contributors type:design UI/UX or design-related updates gssoc:approved Approved for GSSoC scoring labels May 18, 2026
@Abfa41
Copy link
Copy Markdown
Collaborator

Abfa41 commented May 18, 2026

@Darshan200531 bro, could you please add before and after screenshots of the UI?? It will help us in reviewing faster..

@Darshan200531
Copy link
Copy Markdown
Author

Before :-
Screenshot 2026-05-18 130345

After :-
Screenshot 2026-05-18 162604
Screenshot 2026-05-18 162620

@Darshan200531 Darshan200531 reopened this May 19, 2026
@Sachinchaurasiya360 Sachinchaurasiya360 merged commit a6f15f5 into Sachinchaurasiya360:main May 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue Good for newcomers gssoc:approved Approved for GSSoC scoring level:beginner Good for first-time contributors type:design UI/UX or design-related updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants