Skip to content

Commit

Permalink
Fix initialState useDarkLight in loggedinbutton.jsx
Browse files Browse the repository at this point in the history
Resolved the issue where the light mode button was incorrectly displayed upon hovering over the avatar in light mode. Adjusted the code to now show the dark mode button as expected when hovering over the avatar. This commit addresses the problem reported in [Issue #245](#245).
  • Loading branch information
PaoloDiBello authored Nov 13, 2023
1 parent 798110e commit f994cf1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/login/loggedinbutton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useSelectedLayoutSegments } from "next/navigation";

function useDarkLight() {
const [activeTheme, setActiveTheme] = useState(
document?.body?.dataset?.theme? document.body.dataset.theme: "light",,
document?.body?.dataset?.theme || "light",
);
const inactiveTheme = activeTheme === "light" ? "dark" : "light";
//...
Expand Down

0 comments on commit f994cf1

Please sign in to comment.