1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-08-07 11:55:17 +02:00

Moved Themer to Settings. Added option to set default theme

This commit is contained in:
Paweł Malak 2021-11-18 13:47:27 +01:00
parent 426766225b
commit e2285e2deb
20 changed files with 156 additions and 54 deletions

View file

@ -8,17 +8,10 @@ import {
UpdateQueryAction,
} from '../actions/config';
import axios from 'axios';
import {
ApiResponse,
Config,
DockerSettingsForm,
OtherSettingsForm,
Query,
SearchForm,
WeatherForm,
} from '../../interfaces';
import { ApiResponse, Config, Query } from '../../interfaces';
import { ActionType } from '../action-types';
import { storeUIConfig, applyAuth } from '../../utility';
import { ConfigFormData } from '../../types';
const keys: (keyof Config)[] = [
'useAmericanDate',
@ -50,9 +43,7 @@ export const getConfig = () => async (dispatch: Dispatch<GetConfigAction>) => {
};
export const updateConfig =
(
formData: WeatherForm | OtherSettingsForm | SearchForm | DockerSettingsForm
) =>
(formData: ConfigFormData) =>
async (dispatch: Dispatch<UpdateConfigAction>) => {
try {
const res = await axios.put<ApiResponse<Config>>(

View file

@ -2,7 +2,7 @@ import { Dispatch } from 'redux';
import { SetThemeAction } from '../actions/theme';
import { ActionType } from '../action-types';
import { Theme } from '../../interfaces/Theme';
import { themes } from '../../components/Themer/themes.json';
import { themes } from '../../components/Settings/Themer/themes.json';
export const setTheme =
(name: string) => (dispatch: Dispatch<SetThemeAction>) => {