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:
mgabdev
2020-11-09 13:28:43 -06:00
parent f806fddb5f
commit 21937d9e09
9 changed files with 123 additions and 23 deletions

View File

@@ -25,6 +25,7 @@ import news from './news'
import notifications from './notifications'
import polls from './polls'
import popover from './popover'
import promotions from './promotions'
import push_notifications from './push_notifications'
import relationships from './relationships'
import reports from './reports'
@@ -70,6 +71,7 @@ const reducers = {
notifications,
polls,
popover,
promotions,
push_notifications,
relationships,
reports,

View 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
}
}