-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Florian Lenz
committed
Aug 6, 2018
1 parent
cfb67fd
commit 6bb77d1
Showing
3 changed files
with
32 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
}) | ||
|
||
}) | ||
|
||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters