Skip to content

Commit

Permalink
feat(Modal): returns isOpen from useModal too
Browse files Browse the repository at this point in the history
  • Loading branch information
zouxuoz committed Jan 9, 2020
1 parent b392896 commit 1cc90c7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/Modal/useModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ function useModal(id) {
const dialogContext = useContext(ModalContext);

const args = _.get(dialogContext, ['state', id, 'args'], {});
const isOpen = _.get(dialogContext, ['state', id, 'isOpen'], false);

return {
openModal: dialogContext.openModal,
closeModal: dialogContext.closeModal,
args,
isOpen,
};
}

Expand Down

0 comments on commit 1cc90c7

Please sign in to comment.