Added new visits settings

This commit is contained in:
Alejandro Celaya
2021-03-06 10:56:49 +01:00
parent ad46927750
commit d3f9650e82
8 changed files with 40 additions and 7 deletions

View File

@@ -3,6 +3,7 @@ import { dissoc, mergeDeepRight } from 'ramda';
import { buildReducer } from '../../utils/helpers/redux';
import { RecursivePartial } from '../../utils/utils';
import { Theme } from '../../utils/theme';
import { DateInterval } from '../../utils/dates/types';
export const SET_SETTINGS = 'shlink/realTimeUpdates/SET_SETTINGS';
@@ -24,10 +25,15 @@ export interface UiSettings {
theme: Theme;
}
export interface VisitsSettings {
defaultInterval: DateInterval;
}
export interface Settings {
realTimeUpdates: RealTimeUpdatesSettings;
shortUrlCreation?: ShortUrlCreationSettings;
ui?: UiSettings;
visits?: VisitsSettings;
}
const initialState: Settings = {
@@ -40,6 +46,9 @@ const initialState: Settings = {
ui: {
theme: 'light',
},
visits: {
defaultInterval: 'last30Days',
},
};
type SettingsAction = Action & Settings;