This commit is contained in:
mgabdev
2020-05-01 01:50:27 -04:00
parent c15d4f12dc
commit 8e349c368c
99 changed files with 1268 additions and 887 deletions

View File

@@ -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,
}
}