Skip to content

Replace native browser alerts with a Toast/notification component in Login #36

Description

@teja-311

Feature Request

Login.jsx currently uses window.alert() / alert() for all user feedback such as login errors, success messages, forgot-password flow, and reset-password flow (8 call sites total). Native browser alerts block the entire page, can't be styled, and feel unprofessional compared to the rest of the UI.

Image

Proposed Solution

Add a small, reusable Toast component (frontend/src/components/common/Toast.jsx):

  • Auto-dismisses after ~3 seconds
  • Has a manual close (×) button
  • Supports success / error / info styling
  • No external dependencies, plain React state + inline styles

Replace all alert() calls in Login.jsx with this component.

Scope Note

There are ~27 alert() calls across other files in the codebase (AdminHome, AllCourses, Register, TeacherHome, etc.) — this issue is scoped to Login.jsx only to keep the change focused and reviewable. Happy to open follow-up issues for the other files if this is merged.

Additional Context

I'd like to combine this with issue #24 (Settings dropdown overlap + Activity Logs filter panel overflow) into a single PR, since I'm already working on that fix and this keeps related frontend UX polish together, per your earlier suggestion to combine smaller fixes into one meaningful PR.

I've already built and tested this locally. happy to open the PR if assigned.

Metadata

Metadata

Assignees

Labels

ECSoC26Required label for a PR to be eligible for Sentinel scoringenhancementNew feature or improvement request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions