Skip to content

Bring SignUp page up to par with Login dark mode, loading state, password toggle#269

Open
zen-ash-dev wants to merge 3 commits into
GitMetricsLab:mainfrom
zen-ash-dev:main
Open

Bring SignUp page up to par with Login dark mode, loading state, password toggle#269
zen-ash-dev wants to merge 3 commits into
GitMetricsLab:mainfrom
zen-ash-dev:main

Conversation

@zen-ash-dev
Copy link
Copy Markdown

@zen-ash-dev zen-ash-dev commented May 16, 2026

Related Issue


Description

The SignUp page was missing a bunch of stuff Login already had. No dark/light mode support, no loading state on submit, no way to see your password while typing, no animations. The button used onClick instead of a proper <form onSubmit>, and error messages were generic regardless of what the backend returned. There was also a dead block of commented-out mock code in handleSubmit.
Changes made:

  • Wired up ThemeContext so the page follows the app-wide dark/light toggle instead of being locked into one gradient
  • Added an isLoading state — the button disables itself and shows "Creating account..." while the request is in flight
  • Added password show/hide toggle using Eye/EyeOff icons from lucide-react
  • Moved from button onClick to proper <form onSubmit> — pressing Enter now works
  • Error handling now pulls error.response?.data?.message from the backend instead of hiding behind "Something went wrong"
  • Added framer-motion fade-in animations on the branding section and the form card
  • Added autoComplete attributes on all three inputs
  • Removed the commented-out mock API code block

How Has This Been Tested?

  1. Ran npm run dev, navigated to /signup
  2. Toggled dark/light mode on other pages — the SignUp page switches between purple-dark and light themes
  3. Filled the form and clicked the eye icon — password toggles between hidden and visible
  4. Clicked submit — button shows "Creating account..." and is greyed out
  5. Submitted with empty fields — HTML5 validation fires
  6. Built with npm run build — no type errors, no lint warnings

Screenshots (if applicable)

Dark mode Light mode Password visible
![dark](
1-signup-dark ) | ![light]( 3-signup-light ) | ![password]( 2-signup-password-visible ) |

Type of Change

  • Bug fix
  • New feature
  • Code style update
  • Breaking change
  • Documentation update

@netlify
Copy link
Copy Markdown

netlify Bot commented May 16, 2026

Deploy Preview for github-spy ready!

Name Link
🔨 Latest commit 1c05cf7
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a07e94ecded6d00082790ac
😎 Deploy Preview https://deploy-preview-269--github-spy.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 16, 2026

Warning

Rate limit exceeded

@zen-ash-dev has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 40 minutes and 52 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cad60590-7f52-4d5f-82ee-77fc2a066825

📥 Commits

Reviewing files that changed from the base of the PR and between 3722908 and 1c05cf7.

📒 Files selected for processing (1)
  • src/App.tsx
📝 Walkthrough

Walkthrough

The Signup component evolved from a static dark-themed form into a theme-aware, animated interface with enhanced form interaction. ThemeContext integration enables dark/light mode switching, framer-motion adds entry animations, and the submission flow now gates loading state with try/catch/finally error handling and improved backend message extraction.

Changes

Sign-up Page Theme and Form Behavior

Layer / File(s) Summary
Imports, state setup, and context consumption
src/pages/Signup/Signup.tsx
Adds imports for ThemeContext, framer-motion, axios, and local state for message, isLoading, and showPassword alongside existing form fields.
Form submission handler with async control and error extraction
src/pages/Signup/Signup.tsx
handleSubmit now wraps axios.post in try/catch/finally, sets isLoading before the request, reads backend error messages from error.response?.data?.message, and navigates to /login when response message matches "User created successfully".
Hero section with theme-driven backgrounds and animations
src/pages/Signup/Signup.tsx
Page layout rebuilt with theme-dependent gradient backgrounds, decorative elements, and framer-motion entry animation applied to the title/logo area.
Form inputs with theme-dependent styling and password visibility toggle
src/pages/Signup/Signup.tsx
Username and email fields reworked with theme-dependent styling; password field adds Eye/EyeOff icon toggle controlled by showPassword state; submit button disables while isLoading and changes text during request.
Success/error feedback banner and navigation footer
src/pages/Signup/Signup.tsx
Success/error banner remains substring-driven but is restyled for the new theme design; login link styling and footer gradient overlay updated for consistency.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Suggested labels

gssoc25, level1

Poem

🐰 A sign-up page now wears both dark and light,
With passwords hidden, then revealed to sight.
Animations dance as the forms load and glow,
Error messages caught from the server below—
Theme-aware, animated, and ready to flow! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and specifically summarizes the main changes: bringing the SignUp page to feature parity with Login (dark mode, loading state, password toggle).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description check ✅ Passed Pull request description is complete and comprehensive, covering all required template sections with detailed explanations of changes and testing.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

🎉 Thank you @zen-ash-dev for your contribution. Please make sure your PR follows https://github.com/GitMetricsLab/github_tracker/blob/main/CONTRIBUTING.md#-pull-request-guidelines

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)
src/pages/Signup/Signup.tsx (1)

194-202: ⚡ Quick win

Add accessible name/state to the password visibility toggle.

The icon-only button needs an aria-label (and preferably aria-pressed) so screen-reader users can understand and operate it reliably.

Suggested fix
               <button
                 type="button"
                 onClick={() => setShowPassword(!showPassword)}
+                aria-label={showPassword ? "Hide password" : "Show password"}
+                aria-pressed={showPassword}
                 className={`absolute inset-y-0 right-0 pr-4 flex items-center ${
                   mode === "dark" ? "text-slate-400 hover:text-white" : "text-gray-500 hover:text-gray-800"
                 } transition-colors duration-200`}
               >
🤖 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 `@src/pages/Signup/Signup.tsx` around lines 194 - 202, The password visibility
toggle button lacks accessible name/state; update the button rendered near
showPassword and setShowPassword to include an aria-label that changes with
state (e.g., "Show password" when showPassword is false and "Hide password" when
true) and add aria-pressed={showPassword} so screen readers know its toggle
state; keep the existing onClick and type="button" behavior and ensure the
accessible text is tied to the showPassword boolean used by the Eye/EyeOff
icons.
🤖 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 `@src/pages/Signup/Signup.tsx`:
- Around line 44-46: The redirect is currently gated on an exact
response.data.message string ("User created successfully"), which is fragile;
update the success check in the signup handler (the code that calls
navigate("/login") using the response variable) to rely on a stable indicator
such as HTTP status (e.g., response.status in the 2xx range), a boolean success
flag (response.data.success === true), or presence of a created user id
(response.data.user?.id) instead of the verbose message, and then call
navigate("/login") when that stable condition is met; also keep existing error
handling paths intact so failures still surface to the user.
- Around line 36-42: handleSubmit can be invoked multiple times before React
updates state, so add an early guard using a mutable ref (e.g., isSubmittingRef)
to block duplicate POSTs: at the top of handleSubmit return immediately if
isSubmittingRef.current is true, then set isSubmittingRef.current = true and
setIsLoading(true) before the try, and reset isSubmittingRef.current = false
(and setIsLoading(false)) in the finally block; reference handleSubmit,
isSubmittingRef, setIsLoading to locate where to implement this.

---

Nitpick comments:
In `@src/pages/Signup/Signup.tsx`:
- Around line 194-202: The password visibility toggle button lacks accessible
name/state; update the button rendered near showPassword and setShowPassword to
include an aria-label that changes with state (e.g., "Show password" when
showPassword is false and "Hide password" when true) and add
aria-pressed={showPassword} so screen readers know its toggle state; keep the
existing onClick and type="button" behavior and ensure the accessible text is
tied to the showPassword boolean used by the Eye/EyeOff icons.
🪄 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: b212a702-cf07-4dff-a126-914ca840cb98

📥 Commits

Reviewing files that changed from the base of the PR and between 7a15543 and 3722908.

📒 Files selected for processing (1)
  • src/pages/Signup/Signup.tsx

Comment on lines 36 to +42
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
setIsLoading(true);

try {
const response = await axios.post(`${backendUrl}/api/auth/signup`,
formData // Include cookies for session
);
setMessage(response.data.message); // Show success message from backend

// Navigate to login page after successful signup
if (response.data.message === 'User created successfully') {
navigate("/login");}


// // Simulate API call (replace with your actual backend integration)
// try {
// // Mock successful signup
// setMessage("Account created successfully! Redirecting to login...");

// // In your actual implementation, integrate with your backend here:
// // const response = await fetch(`${backendUrl}/api/auth/signup`, {
// // method: 'POST',
// // headers: { 'Content-Type': 'application/json' },
// // body: JSON.stringify(formData)
// // });

// setTimeout(() => {
// // Navigate to login page in your actual implementation
// console.log("Redirecting to login page...");
// }, 2000);

} catch (error) {
setMessage("Something went wrong. Please try again.");
const response = await axios.post(`${backendUrl}/api/auth/signup`, formData);
setMessage(response.data.message);
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

Prevent duplicate submit requests in handleSubmit.

Line 38 sets loading, but there’s no early guard; fast repeated Enter/click can still trigger multiple POSTs before re-render.

Suggested fix
 const handleSubmit = async (e: React.FormEvent) => {
   e.preventDefault();
+  if (isLoading) return;
   setIsLoading(true);
📝 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
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
setIsLoading(true);
try {
const response = await axios.post(`${backendUrl}/api/auth/signup`,
formData // Include cookies for session
);
setMessage(response.data.message); // Show success message from backend
// Navigate to login page after successful signup
if (response.data.message === 'User created successfully') {
navigate("/login");}
// // Simulate API call (replace with your actual backend integration)
// try {
// // Mock successful signup
// setMessage("Account created successfully! Redirecting to login...");
// // In your actual implementation, integrate with your backend here:
// // const response = await fetch(`${backendUrl}/api/auth/signup`, {
// // method: 'POST',
// // headers: { 'Content-Type': 'application/json' },
// // body: JSON.stringify(formData)
// // });
// setTimeout(() => {
// // Navigate to login page in your actual implementation
// console.log("Redirecting to login page...");
// }, 2000);
} catch (error) {
setMessage("Something went wrong. Please try again.");
const response = await axios.post(`${backendUrl}/api/auth/signup`, formData);
setMessage(response.data.message);
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
if (isLoading) return;
setIsLoading(true);
try {
const response = await axios.post(`${backendUrl}/api/auth/signup`, formData);
setMessage(response.data.message);
🤖 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 `@src/pages/Signup/Signup.tsx` around lines 36 - 42, handleSubmit can be
invoked multiple times before React updates state, so add an early guard using a
mutable ref (e.g., isSubmittingRef) to block duplicate POSTs: at the top of
handleSubmit return immediately if isSubmittingRef.current is true, then set
isSubmittingRef.current = true and setIsLoading(true) before the try, and reset
isSubmittingRef.current = false (and setIsLoading(false)) in the finally block;
reference handleSubmit, isSubmittingRef, setIsLoading to locate where to
implement this.

Comment on lines +44 to +46
if (response.data.message === "User created successfully") {
navigate("/login");
}
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

Don’t gate redirect on an exact response message string.

Line 44 couples success flow to "User created successfully". Any backend wording change can leave users stuck on signup even after successful creation.

Suggested fix
-      if (response.data.message === "User created successfully") {
+      if (response.status >= 200 && response.status < 300) {
         navigate("/login");
       }
📝 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
if (response.data.message === "User created successfully") {
navigate("/login");
}
if (response.status >= 200 && response.status < 300) {
navigate("/login");
}
🤖 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 `@src/pages/Signup/Signup.tsx` around lines 44 - 46, The redirect is currently
gated on an exact response.data.message string ("User created successfully"),
which is fragile; update the success check in the signup handler (the code that
calls navigate("/login") using the response variable) to rely on a stable
indicator such as HTTP status (e.g., response.status in the 2xx range), a
boolean success flag (response.data.success === true), or presence of a created
user id (response.data.user?.id) instead of the verbose message, and then call
navigate("/login") when that stable condition is met; also keep existing error
handling paths intact so failures still surface to the user.

@zen-ash-dev
Copy link
Copy Markdown
Author

Hi @mehul-m-prajapati ,
Please review and merge at your earliest convenience to avoid any future conflicts.
Looking forward to your approval. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🚀 Feature: Improve SignUp page design with dark/light mode, loading state, password visibility toggle, and animations

1 participant