mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-15 03:53:51 +00:00
Added components and logic to dynamically change theme
This commit is contained in:
committed by
Alejandro Celaya
parent
f313a39b81
commit
9dbf790cc8
@@ -2,6 +2,7 @@ import { Action } from 'redux';
|
||||
import { dissoc, mergeDeepRight } from 'ramda';
|
||||
import { buildReducer } from '../../utils/helpers/redux';
|
||||
import { RecursivePartial } from '../../utils/utils';
|
||||
import { Theme } from '../../utils/theme';
|
||||
|
||||
export const SET_SETTINGS = 'shlink/realTimeUpdates/SET_SETTINGS';
|
||||
|
||||
@@ -19,9 +20,14 @@ export interface ShortUrlCreationSettings {
|
||||
validateUrls: boolean;
|
||||
}
|
||||
|
||||
export interface UiSettings {
|
||||
theme: Theme;
|
||||
}
|
||||
|
||||
export interface Settings {
|
||||
realTimeUpdates: RealTimeUpdatesSettings;
|
||||
shortUrlCreation?: ShortUrlCreationSettings;
|
||||
ui?: UiSettings;
|
||||
}
|
||||
|
||||
const initialState: Settings = {
|
||||
@@ -31,6 +37,9 @@ const initialState: Settings = {
|
||||
shortUrlCreation: {
|
||||
validateUrls: false,
|
||||
},
|
||||
ui: {
|
||||
theme: 'light',
|
||||
},
|
||||
};
|
||||
|
||||
type SettingsAction = Action & Settings;
|
||||
@@ -55,3 +64,8 @@ export const setShortUrlCreationSettings = (settings: ShortUrlCreationSettings):
|
||||
type: SET_SETTINGS,
|
||||
shortUrlCreation: settings,
|
||||
});
|
||||
|
||||
export const setUiSettings = (settings: UiSettings): PartialSettingsAction => ({
|
||||
type: SET_SETTINGS,
|
||||
ui: settings,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user