-
Notifications
You must be signed in to change notification settings - Fork 1
Remove role switcher + profile switches #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,7 +4,6 @@ import { useRouter } from "next/navigation"; | |||||||||||||||||
| import { useAuth } from "@/app/context/AuthContext"; | ||||||||||||||||||
| import { useState, useEffect } from "react"; | ||||||||||||||||||
| import { useTheme } from "@/app/context/ThemeContext"; | ||||||||||||||||||
| import { Switch } from "@/components/ui/switch"; | ||||||||||||||||||
|
|
||||||||||||||||||
| export default function ProfilePage() { | ||||||||||||||||||
| const router = useRouter(); | ||||||||||||||||||
|
|
@@ -197,26 +196,33 @@ export default function ProfilePage() { | |||||||||||||||||
| <span className="text-lg">🌙</span> | ||||||||||||||||||
| <span className="font-medium">Dark Mode</span> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| <Switch | ||||||||||||||||||
| checked={theme === "dark"} | ||||||||||||||||||
| onCheckedChange={() => toggleTheme()} | ||||||||||||||||||
| <button | ||||||||||||||||||
| onClick={toggleTheme} | ||||||||||||||||||
| className="rounded-lg border border-stone-200 dark:border-stone-700 px-3 py-1.5 text-xs font-bold hover:bg-stone-50 dark:hover:bg-stone-700/40 transition-colors" | ||||||||||||||||||
| aria-label="Toggle dark mode" | ||||||||||||||||||
| /> | ||||||||||||||||||
| > | ||||||||||||||||||
| {theme === "dark" ? "On" : "Off"} | ||||||||||||||||||
| </button> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| )} | ||||||||||||||||||
| <div className="flex items-center justify-between p-3 rounded-lg border border-stone-200 dark:border-stone-700"> | ||||||||||||||||||
| <div className="flex items-center gap-3"> | ||||||||||||||||||
| <span className="text-lg">🔔</span> | ||||||||||||||||||
| <span className="font-medium">Notifications</span> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| <Switch | ||||||||||||||||||
| checked={notificationsEnabled} | ||||||||||||||||||
| onCheckedChange={(checked) => { | ||||||||||||||||||
| setNotificationsEnabled(checked); | ||||||||||||||||||
| localStorage.setItem("quickbite_notifications_enabled", String(checked)); | ||||||||||||||||||
| <button | ||||||||||||||||||
| onClick={() => { | ||||||||||||||||||
| setNotificationsEnabled((prev) => { | ||||||||||||||||||
| const next = !prev; | ||||||||||||||||||
| localStorage.setItem("quickbite_notifications_enabled", String(next)); | ||||||||||||||||||
| return next; | ||||||||||||||||||
| }); | ||||||||||||||||||
|
Comment on lines
+215
to
+219
|
||||||||||||||||||
| setNotificationsEnabled((prev) => { | |
| const next = !prev; | |
| localStorage.setItem("quickbite_notifications_enabled", String(next)); | |
| return next; | |
| }); | |
| const next = !notificationsEnabled; | |
| setNotificationsEnabled(next); | |
| localStorage.setItem("quickbite_notifications_enabled", String(next)); |
Copilot
AI
Apr 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same accessibility issue for the Notifications toggle: aria-label overrides the "On/Off" text but the control doesn't expose its pressed/checked state. Add aria-pressed (or role="switch" + aria-checked) and ensure the accessible name/description communicates the current state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Dark Mode toggle button uses
aria-label, which overrides the visible "On/Off" text for screen readers, but it does not expose the current state. Consider usingaria-pressed(orrole="switch"+aria-checked) and either removearia-labelor include the current state in it so assistive tech can announce whether dark mode is on/off.