reactjs - Custom content of React Bootstrap Modal -
i'm trying customize react bootstrap modal such customized piece of html+css replace default content of modal. in other words, want keep bootstrap effects replace white background , content of modal own custom html , css. html , css want use put in react component. have tried dialogcomponentclass, dialogclassname etc etc, cannot understand docs how this. want replace content of bootstrap modal component "custompopup". how?
here 2 components:
import react 'react'; import './../styles/popup.css'; import {modal, button} 'react-bootstrap'; class custompopup extends react.component{ constructor(props) { super(props); this.state = { text: props.text }; } render() { return ( <div classname="modalcontainer"> <div classname="container"> <div classname="outerframe"> <div classname="innerframe"> <label classname="challenge">content</label> </div> </div> </div> </div> ); } } export default class popup extends react.component{ constructor(props) { super(props); this.state = { showmodal: false }; } close = () => { this.setstate({ showmodal: false }); } open = () => { this.setstate({ showmodal:true }); } render() { return ( <div classname="modalcontainer"> <button bsstyle="primary" bssize="large" onclick={this.open}>launch demo modal</button> <modal{...this.props} show={this.state.showmodal} dialogcomponentclass={custompopup} > </modal> </div> ); } }
Comments
Post a Comment