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:
@@ -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,
|
||||
|
||||
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