Files
talk/plugins/talk-plugin-moderation-actions/client/reducer.js
T
2017-09-11 11:31:59 -03:00

24 lines
456 B
JavaScript

import {OPEN_TOOLTIP, CLOSE_TOOLTIP} from './constants';
const initialState = {
showTooltipForComment: null,
};
export default function reducer(state = initialState, action) {
switch (action.type) {
case OPEN_TOOLTIP:
return {
...state,
showTooltipForComment: action.id,
};
case CLOSE_TOOLTIP:
return {
...state,
showTooltipForComment: null,
contentSlot: null,
};
default :
return state;
}
}