[ ADD ] react configuration

This commit is contained in:
Kuroi488
2020-11-16 17:14:34 +01:00
parent 89c9cfe099
commit 5078a1a96e
71 changed files with 16891 additions and 0 deletions

View File

@ -0,0 +1,10 @@
import * as types from './LangTypes';
export const setCurrentLang = payload => {
localStorage.setItem('lang', payload);
return { type: types.SET_LANG, payload };
}
export const getCurrentLang = () => {
return { type: types.GET_LANG };
};

View File

@ -0,0 +1,14 @@
import * as types from "./LangTypes";
const INITIAL_STATE = localStorage.getItem("lang") || "en";
export default function locale(state = INITIAL_STATE, action) {
switch (action.type) {
case types.SET_LANG:
return action.payload;
case types.GET_LANG:
return action.payload;
default:
return state;
}
}

View File

@ -0,0 +1,2 @@
export const SET_LANG = 'SET_LANG';
export const GET_LANG = 'GET_LANG';