BIG-18: missing locales in Arabic.

This commit is contained in:
a.bouhuolia
2021-09-23 09:48:32 +02:00
parent 364859a793
commit 9b7382e222
11 changed files with 82 additions and 30 deletions

View File

@@ -84,4 +84,22 @@ export function appIntlIsLoading(toggle) {
type: t.APP_INTL_IS_LOADING,
payload: { isLoading: toggle },
};
}
/**
* Splash start loading.
*/
export function splashStartLoading() {
return {
type: t.SPLASH_START_LOADING,
};
}
/**
* Splash stop loading.
*/
export function splashStopLoading() {
return {
type: t.SPLASH_STOP_LOADING,
}
}

View File

@@ -1,5 +1,5 @@
import { createReducer } from '@reduxjs/toolkit';
import { isUndefined } from 'lodash';
import { isUndefined, isNumber } from 'lodash';
import t from 'store/types';
import { persistReducer, purgeStoredState } from 'redux-persist';
import storage from 'redux-persist/lib/storage';
@@ -16,6 +16,7 @@ const initialState = {
topbarEditViewId: null,
requestsLoading: 0,
backLink: false,
splashScreenLoading: null,
appIsLoading: true,
appIntlIsLoading: true,
};
@@ -102,14 +103,17 @@ const reducerInstance = createReducer(initialState, {
state.backLink = backLink;
},
[t.APP_IS_LOADING]: (state, action) => {
const { isLoading } = action.payload;
state.appIsLoading = isLoading;
[t.SPLASH_START_LOADING]: (state) => {
if (isNumber(state.splashScreenLoading)) {
state.splashScreenLoading += 1;
} else {
state.splashScreenLoading = 1;
}
},
[t.APP_INTL_IS_LOADING]: (state, action) => {
const { isLoading } = action.payload;
state.appIntlIsLoading = isLoading;
[t.SPLASH_STOP_LOADING]: (state) => {
state.splashScreenLoading -= 1;
state.splashScreenLoading = Math.max(state.splashScreenLoading, 0);
},
[t.RESET]: () => {

View File

@@ -14,6 +14,6 @@ export default {
SET_TOPBAR_EDIT_VIEW: 'SET_TOPBAR_EDIT_VIEW',
SIDEBAR_EXPEND_TOGGLE: 'SIDEBAR_EXPEND_TOGGLE',
SET_DASHBOARD_BACK_LINK: 'SET_DASHBOARD_BACK_LINK',
APP_IS_LOADING: 'APP_IS_LOADING',
APP_INTL_IS_LOADING: 'APP_INTL_IS_LOADING'
SPLASH_START_LOADING: 'SPLASH_START_LOADING',
SPLASH_STOP_LOADING: 'SPLASH_STOP_LOADING',
};