[DE mobile] Remove actions and redusers for redux

This commit is contained in:
JuliaSvinareva 2020-11-18 16:48:21 +03:00
parent 663e373ccf
commit 2408567cb6
5 changed files with 0 additions and 73 deletions

View file

@ -1,9 +0,0 @@
import React from "react";
import { resetPageOrient } from "../store/actions/actions";
export default function (dispatch, getState, api) {
// document settings
api.asc_registerCallback('asc_onPageOrient', (isPortrait) => {
dispatch(resetPageOrient(isPortrait === true));
});
}

View file

@ -1,30 +0,0 @@
import registerApi from '../ApiRegisterCallback';
export const INIT_API = 'INIT_API';
export const initApi = value => {
return (dispatch, getState) => {
registerApi(dispatch, getState, value);
dispatch({
type: INIT_API,
api: value
});
}
};
// action of settings
export const RESET_PAGE_ORIENT = 'RESET_PAGE_ORIENT';
export const resetPageOrient = value => {
return {
type: RESET_PAGE_ORIENT,
isPortrait: value
}
};
export const changePageOrient = (value) => {
return (dispatch, getState) => {
const { api } = getState();
if (api.apiObj) {
api.apiObj.change_PageOrient(value);
}
};
};

View file

@ -1,10 +0,0 @@
// action types
export const RESET_PAGE_ORIENT = 'RESET_PAGE_ORIENT';
// action creators
export const resetPageOrient = value => {
return {
type: RESET_PAGE_ORIENT,
isPortrait: value
}
};

View file

@ -1,12 +0,0 @@
import { INIT_API } from '../actions/actions'
const apiReducer = (state = [], action) => {
if (action.type == INIT_API) {
return Object.assign({}, state, {
apiObj: action.api
});
}
return state;
};
export default apiReducer ;

View file

@ -1,12 +0,0 @@
import { RESET_PAGE_ORIENT } from '../actions/actions'
const settingsReducer = (state = [], action) => {
if (action.type == RESET_PAGE_ORIENT) {
return Object.assign({}, state, {
isPortrait: action.isPortrait
});
}
return state;
};
export default settingsReducer ;