Skip to content

Commit

Permalink
[vm] added modal and message handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Lenz committed Jun 26, 2018
1 parent cb5adcd commit 9e0ce11
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const Pangea = {
sendMessage: vm.sendMessage,
pangeaETHAddress: vm.pangeaETHAddress,
setOpenHandler: vm.setOpenHandler,
showModal: vm.showModal,
setMessageHandler: vm.setMessageHandler
};

export default Object.assign(UIElements, Pangea);
18 changes: 18 additions & 0 deletions vm-raw/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,22 @@ export default {
* @param {function} callback
*/
setOpenHandler: global.onOpen,

/**
* @desc show modal
* @param {string} title Title to display on modal
* @param {string} layout Layout of the modal body
* @param {function|null} will be called when modal is rendered
*/
showModal: global.showModal,

/**
* @typedef {Object} DAppMessage
*
* @desc render a message and return json layout
* @param {DAppMessage} dAppMessage The DApp message
* @param {Object} context
* @param {function} callback
*/
setMessageHandler: global.setMessageHandler
}

0 comments on commit 9e0ce11

Please sign in to comment.