From 6bb77d18547f83775900a692e11d1fef72dd05f0 Mon Sep 17 00:00:00 2001 From: Florian Lenz Date: Mon, 6 Aug 2018 15:17:38 +0300 Subject: [PATCH] [project] updated app.js --- app.js | 53 +++++++++++++++++++++++++---------------------- package-lock.json | 6 +++--- package.json | 2 +- 3 files changed, 32 insertions(+), 29 deletions(-) diff --git a/app.js b/app.js index 85ce92d..7aa1b02 100644 --- a/app.js +++ b/app.js @@ -1,33 +1,36 @@ import pangea from 'pangea-sdk' const { - renderUI, - View, - Text, setOpenHandler, - setMessageHandler, - showModal, + newModalUIID, + renderModal, + Modal, + Container } = pangea; -// this handler will be called -// when the user opens your DApp -setOpenHandler((payload, cb) => { - - // layout that will be rendered - const layout = new View( - {}, - [ - new Text( - {}, - "Hi there" - ), - new Text( - {}, - "This is the Pange VM" - ) - ] - ); - - showModal("Select Action", renderUI(layout), cb) + +class DemoModal extends Modal { + render(){ + return ( + Hi there + ) + } +} + +setOpenHandler((cb) => { + + // obtain a new modal id + newModalUIID((error, modalUIID) => { + + if (error){ + return cb(error) + } + + renderModal(, () => { + // once the modal got rendered, we can "close" the open process + cb() + }) + + }) }); diff --git a/package-lock.json b/package-lock.json index 85e7074..e5b5882 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5575,9 +5575,9 @@ "dev": true }, "pangea-sdk": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/pangea-sdk/-/pangea-sdk-0.2.0.tgz", - "integrity": "sha512-UzVWU7bG5m/uaiqzuD5EjX5I21NPavg4OOLyMd5MrbVFV7Y9OJL+dfAS5ZdQytBpN/6ELgToOUg1PbmLK3N+Cg==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pangea-sdk/-/pangea-sdk-0.6.0.tgz", + "integrity": "sha512-vlPRrLWmKo6JIjNrzxiQv3REf8QHo6ZtieeQO7aEBvA64F6UA7tl9CDnVMjK7sIdBW4BvX7IUupvXRjCWgUrqQ==", "requires": { "babel-cli": "6.26.0", "babel-plugin-add-module-exports": "0.3.2", diff --git a/package.json b/package.json index 5c81f3c..35df24c 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "webpack-cli": "^2.0.10" }, "dependencies": { - "pangea-sdk": "^0.2.0", + "pangea-sdk": "^0.6.0", "truffle": "^4.1.13" }, "pangea_dapp": {