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:
@@ -38,6 +38,16 @@ const toServerSideType = columnType => {
|
||||
|
||||
export const getFilters = (state, { contextType }) => state.get('filters', ImmutableList()).filter(filter => contextType && filter.get('context').includes(toServerSideType(contextType)) && (filter.get('expires_at') === null || Date.parse(filter.get('expires_at')) > (new Date())));
|
||||
|
||||
export const getPromotions = () => {
|
||||
return createSelector([
|
||||
(state) => state,
|
||||
(state) => state.getIn(['accounts', me, 'is_pro']),
|
||||
(state) => state.get('promotions'),
|
||||
], (state, isPro, promotions) => {
|
||||
return !isPro ? promotions : ImmutableList()
|
||||
})
|
||||
}
|
||||
|
||||
const escapeRegExp = string =>
|
||||
string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user