Skip to content

Commit

Permalink
[project] updated app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Lenz committed Aug 6, 2018
1 parent cfb67fd commit 6bb77d1
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 29 deletions.
53 changes: 28 additions & 25 deletions app.js
Original file line number Diff line number Diff line change
@@ -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 (
<Text>Hi there</Text>
)
}
}

setOpenHandler((cb) => {

// obtain a new modal id
newModalUIID((error, modalUIID) => {

if (error){
return cb(error)
}

renderModal(<DemoModal container={new Container(modalUIID)}/>, () => {
// once the modal got rendered, we can "close" the open process
cb()
})

})

});
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 6bb77d1

Please sign in to comment.