Progress
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
import Immutable from 'immutable';
|
||||
import {
|
||||
DROPDOWN_MENU_OPEN,
|
||||
DROPDOWN_MENU_CLOSE,
|
||||
} from '../actions/dropdown_menu';
|
||||
|
||||
const initialState = Immutable.Map({ openId: null, placement: null, keyboard: false });
|
||||
|
||||
export default function dropdownMenu(state = initialState, action) {
|
||||
switch (action.type) {
|
||||
case DROPDOWN_MENU_OPEN:
|
||||
return state.merge({ openId: action.id, placement: action.placement, keyboard: action.keyboard });
|
||||
case DROPDOWN_MENU_CLOSE:
|
||||
return state.get('openId') === action.id ? state.set('openId', null) : state;
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { combineReducers } from 'redux-immutable';
|
||||
import dropdown_menu from './dropdown_menu';
|
||||
import popover from './popover';
|
||||
import timelines from './timelines';
|
||||
import meta from './meta';
|
||||
import alerts from './alerts';
|
||||
@@ -40,7 +40,7 @@ import sidebar from './sidebar';
|
||||
import status_revision_list from './status_revision_list';
|
||||
|
||||
const reducers = {
|
||||
dropdown_menu,
|
||||
popover,
|
||||
timelines,
|
||||
meta,
|
||||
alerts,
|
||||
|
||||
28
app/javascript/gabsocial/reducers/popover.js
Normal file
28
app/javascript/gabsocial/reducers/popover.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import Immutable from 'immutable'
|
||||
import {
|
||||
POPOVER_OPEN,
|
||||
POPOVER_CLOSE,
|
||||
} from '../actions/popover'
|
||||
|
||||
const initialState = Immutable.Map({
|
||||
popoverType: null,
|
||||
placement: null,
|
||||
keyboard: false
|
||||
})
|
||||
|
||||
export default function popoverMenu(state = initialState, action) {
|
||||
switch (action.type) {
|
||||
case POPOVER_OPEN:
|
||||
console.log("POPOVER_OPEN:", action)
|
||||
return {
|
||||
popoverType: action.popoverType,
|
||||
placement: action.placement,
|
||||
keyboard: action.keyboard
|
||||
}
|
||||
case POPOVER_CLOSE:
|
||||
console.log("POPOVER_CLOSE:", action)
|
||||
return initialState;
|
||||
default:
|
||||
return state
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,6 @@ import {
|
||||
FAVOURITED_STATUSES_EXPAND_SUCCESS,
|
||||
FAVOURITED_STATUSES_EXPAND_FAIL,
|
||||
} from '../actions/favourites';
|
||||
import {
|
||||
PINNED_STATUSES_FETCH_SUCCESS,
|
||||
} from '../actions/pin_statuses';
|
||||
import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
|
||||
import {
|
||||
FAVOURITE_SUCCESS,
|
||||
@@ -75,8 +72,6 @@ export default function statusLists(state = initialState, action) {
|
||||
return prependOneToList(state, 'favourites', action.status);
|
||||
case UNFAVOURITE_SUCCESS:
|
||||
return removeOneFromList(state, 'favourites', action.status);
|
||||
case PINNED_STATUSES_FETCH_SUCCESS:
|
||||
return normalizeList(state, 'pins', action.statuses, action.next);
|
||||
case PIN_SUCCESS:
|
||||
return prependOneToList(state, 'pins', action.status);
|
||||
case UNPIN_SUCCESS:
|
||||
|
||||
Reference in New Issue
Block a user