Skip to content

Commit

Permalink
Merge pull request #1072 from aarya-16/develop
Browse files Browse the repository at this point in the history
Added User theme(Light/Dark) preference detection
  • Loading branch information
ajhollid authored Oct 28, 2024
2 parents 86ab22d + 7a55997 commit 9e26a0d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Client/src/Features/UI/uiSlice.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { createSlice } from "@reduxjs/toolkit";

const initialMode = window?.matchMedia?.('(prefers-color-scheme: dark)')?.matches ? "dark" : "light";

// Initial state for UI settings.
// Add more settings as needed (e.g., theme preferences, user settings)
const initialState = {
Expand All @@ -15,7 +17,7 @@ const initialState = {
sidebar: {
collapsed: false,
},
mode: "light",
mode: initialMode,
greeting: { index: 0, lastUpdate: null },
timezone: "America/Toronto",
};
Expand Down

0 comments on commit 9e26a0d

Please sign in to comment.