https://github.com/suhdev/sh-react-modal
A modal component for ReactJS application written in TypeScript.
https://github.com/suhdev/sh-react-modal
Last synced: about 1 year ago
JSON representation
A modal component for ReactJS application written in TypeScript.
- Host: GitHub
- URL: https://github.com/suhdev/sh-react-modal
- Owner: suhdev
- Created: 2017-01-19T20:02:37.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-25T22:08:42.000Z (over 9 years ago)
- Last Synced: 2025-03-09T13:17:43.817Z (over 1 year ago)
- Language: JavaScript
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sh-react-modal
A configurable modal component for ReactJS application written in TypeScript.
```javascript
var el = document.createElement('div');
el.className = 'container';
document.body.appendChild(el);
var service = ShReact.createModalService(el);
service.show({
content:(onSuccess,onHide)=>{
return (
React.createElement('div',{className:'test',onClick:onSuccess,title:'Test Dialog'},'Test')
);
},
props:{
title:"Test Dialog",
hasClose:true,
closeOnBackdrop:false
}})
.then(function(em){
return service.show({
content:(onSuccess,onCancel)=>{
return (null);
},
props:{
buttons:[{
label:'OK',
key:'ok'
},{
label:'Cancel',
key:'cancel'
}]
}});
},function(ez){
console.log(ez);
})
.then(function(et){
console.log(et);
});
```