Added promotions to redux and added selector for setting promotions if not PRO
• Added: - promotions to redux - selector for setting promotions if not PRO • Updated: - StatusList, SidebarPanelGroup to use promotions from redux
This commit is contained in:
23
app/javascript/gabsocial/reducers/promotions.js
Normal file
23
app/javascript/gabsocial/reducers/promotions.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import {
|
||||
List as ImmutableList,
|
||||
fromJS,
|
||||
}from 'immutable'
|
||||
import {
|
||||
PROMOTIONS_FETCH_REQUEST,
|
||||
PROMOTIONS_FETCH_SUCCESS,
|
||||
PROMOTIONS_FETCH_FAIL,
|
||||
} from '../actions/promotions'
|
||||
|
||||
const initialState = ImmutableList()
|
||||
|
||||
export default function promotions(state = initialState, action) {
|
||||
switch (action.type) {
|
||||
case PROMOTIONS_FETCH_REQUEST:
|
||||
case PROMOTIONS_FETCH_FAIL:
|
||||
return initialState
|
||||
case PROMOTIONS_FETCH_SUCCESS:
|
||||
return fromJS(action.items)
|
||||
default:
|
||||
return state
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user