Progress
This commit is contained in:
@@ -2,10 +2,14 @@ export const POPOVER_OPEN = 'POPOVER_OPEN'
|
||||
export const POPOVER_CLOSE = 'POPOVER_CLOSE'
|
||||
|
||||
export function openPopover(type, props) {
|
||||
return {
|
||||
type: POPOVER_OPEN,
|
||||
popoverType: type,
|
||||
popoverProps: props,
|
||||
return function (dispatch, getState) {
|
||||
const currentlyOpenPopover = getState().getIn(['popover', 'popoverType'])
|
||||
|
||||
if (currentlyOpenPopover === type) {
|
||||
dispatch(closePopover(type))
|
||||
} else {
|
||||
dispatch(handleOpenPopover(type, props))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,3 +19,11 @@ export function closePopover(type) {
|
||||
popoverType: type,
|
||||
}
|
||||
}
|
||||
|
||||
const handleOpenPopover = (type, props) => {
|
||||
return {
|
||||
type: POPOVER_OPEN,
|
||||
popoverType: type,
|
||||
popoverProps: props,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user