-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83fc18e
commit 9007502
Showing
4 changed files
with
46 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { | ||
SET_SECTION_TABS, | ||
} from '~/constants/ActionTypes'; | ||
|
||
|
||
export function setSectionTabs(payload) { | ||
return { | ||
type: SET_SECTION_TABS, | ||
payload: payload, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const SET_SECTION_TABS = 'SET_SECTION_TABS'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { SET_SECTION_TABS } from '~/constants/ActionTypes'; | ||
|
||
const initialState = { | ||
error: null, | ||
items: null, | ||
loaded: false, | ||
loading: false, | ||
}; | ||
|
||
/** | ||
* Navigation reducer. | ||
* @function navigation | ||
* @param {Object} state Current state. | ||
* @param {Object} action Action to be handled. | ||
* @returns {Object} New state. | ||
*/ | ||
export default function section_tabs(state = initialState, action = {}) { | ||
if (action.type === SET_SECTION_TABS) { | ||
return { | ||
...state, | ||
error: null, | ||
items: action.payload, | ||
loaded: true, | ||
loading: false, | ||
}; | ||
} | ||
return state; | ||
} |