Skip to content

Commit

Permalink
Add system default theme color
Browse files Browse the repository at this point in the history
  • Loading branch information
lanchana committed Aug 25, 2023
1 parent 311f3b1 commit 95918c0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/insight/src/store/app.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ interface AppState {
const initialTheme = window.localStorage.getItem('theme');
const initialState: AppState = {
loading: false,
theme: initialTheme || 'dark',
theme: initialTheme
? initialTheme
: window.matchMedia?.('(prefers-color-scheme: dark)').matches // System default theme color
? 'dark'
: 'light',
network: '',
currency: '',
};
Expand Down

0 comments on commit 95918c0

Please sign in to comment.