update src/redux/actions/index.js, src/redux/reducers/index.js, Header.js and src/screens/Splash/index.js
parent
2e87980bf9
commit
e4c74efad6
6 changed files with 59 additions and 10 deletions
@ -0,0 +1,10 @@ |
||||
import proxy from "../proxy"; |
||||
|
||||
const config = { |
||||
getBottomNavigation: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("config/bottomNavigations", data, { dispatch }), |
||||
}; |
||||
|
||||
export default config; |
@ -0,0 +1,25 @@ |
||||
const initialState = { |
||||
loading: false, |
||||
error: null, |
||||
bottomNavigations: null, |
||||
}; |
||||
|
||||
export default function config(state = initialState, action) { |
||||
let { type, data } = action; |
||||
switch (type) { |
||||
case "config/bottomNavigations": |
||||
console.log(data); |
||||
return { |
||||
...state, |
||||
loading: false, |
||||
bottomNavigations: data, |
||||
error: null, |
||||
}; |
||||
case "config/loading": |
||||
return { ...state, loading: true }; |
||||
case "config/error": |
||||
return { ...state, loading: false, error: data.message }; |
||||
default: |
||||
return state; |
||||
} |
||||
} |
Loading…
Reference in new issue