react-popup-layer
a popup layer component for react
Example
https://lijinke666.github.io/react-popup-layer/
Development
git clone https://github.com/lijinke666/react-popup-layer
npm install
npm start
Install
npm install react-popup-layer --save
Usage
const margin = margin:"10px 0" PureComponent state = visible: falseMessage visible2: false visible3:false { console this } { this } { this } { this } { this } { this } { this } { console this } { const visiblevisible2visible3 = thisstate return <div> <h2>Example</h2> <hr/> <ol> <li style=margin><button onClick=thisopenModal>open Modal</button></li> <li style=margin><button onClick=thisopenNoFooterModal>open no footer Modal</button></li> <li style=margin><button onClick=thisopenCustomFooterModal>open custom footer Modal</button></li> </ol> <hr /> <ReactPopupLayer title="example title" okText="ok" cancelText="cancel" visible=visible onOk=thisonOk onCancel=thiscancelModal className="my-modal" > <p> <h1>bla bla bla ...</h1> </p> </ReactPopupLayer> <ReactPopupLayer title="wtf!! I have no footer" visible=visible2 footer=false onCancel=thiscancelNoFooterModal className="my-modal" > <p> <h1>bla bla bla ...</h1> <button onClick=thiscancelNoFooterModal>:</button> </p> </ReactPopupLayer> <ReactPopupLayer title="Custom Footer" visible=visible3 onCancel=thiscancelCustomFooterModal footer= <button key="cancel" onClick=thiscancelCustomFooterModal>cancel</button> <button key="ok" onClick=thiscustomOk>ok</button> className="my-modal" > <p> <h1>bla bla bla ...</h1> </p> </ReactPopupLayer> </div> }} ReactDOM