mirror of
https://github.com/wassname/talk.git
synced 2026-07-08 20:49:21 +08:00
24 lines
456 B
JavaScript
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;
|
|
}
|
|
}
|