-
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.
Fixed DetailedLink; Layout functionality
- Loading branch information
Showing
7 changed files
with
162 additions
and
75 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
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
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
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,54 @@ | ||
/** | ||
* Content reducer. | ||
* @module reducers/content/content | ||
*/ | ||
import { GET_CONTENT_TYPE } from '~/constants/ActionTypes'; | ||
|
||
const initialState = { | ||
data: null, | ||
loading: false, | ||
loaded: false, | ||
error: null, | ||
}; | ||
|
||
/** | ||
* Content reducer. | ||
* @function content | ||
* @param {Object} state Current state. | ||
* @param {Object} action Action to be handled. | ||
* @returns {Object} New state. | ||
*/ | ||
export default function contentType(state = initialState, action = {}) { | ||
let { result } = action; | ||
switch (action.type) { | ||
case `${GET_CONTENT_TYPE}_PENDING`: | ||
return { | ||
...state, | ||
data: null, | ||
loading: true, | ||
loaded: false, | ||
error: null, | ||
}; | ||
case `${GET_CONTENT_TYPE}_SUCCESS`: | ||
const data = { | ||
...result, | ||
}; | ||
return { | ||
...state, | ||
data, | ||
loading: false, | ||
loaded: true, | ||
error: null, | ||
}; | ||
case `${GET_CONTENT_TYPE}_FAIL`: | ||
return { | ||
...state, | ||
data: null, | ||
loading: false, | ||
loaded: false, | ||
error: action.error, | ||
}; | ||
default: | ||
return state; | ||
} | ||
} |
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