Set default theme based on system preferences

This commit is contained in:
Alejandro Celaya
2023-12-18 23:05:17 +01:00
parent ddc466b797
commit 8907ea5310
9 changed files with 67 additions and 56 deletions

View File

@@ -2,6 +2,7 @@ import type { PayloadAction, PrepareAction } from '@reduxjs/toolkit';
import { createSlice } from '@reduxjs/toolkit';
import { mergeDeepRight } from '@shlinkio/data-manipulation';
import type { Theme } from '@shlinkio/shlink-frontend-kit';
import { getSystemPreferredTheme } from '@shlinkio/shlink-frontend-kit';
import type {
Settings,
ShortUrlCreationSettings,
@@ -34,7 +35,7 @@ const initialState: AppSettings = {
validateUrls: false,
},
ui: {
theme: 'light',
theme: getSystemPreferredTheme(),
},
visits: {
defaultInterval: 'last30Days',