@@ -62,7 +62,7 @@ module.exports = React.createClass( {
6262
6363 openModal ( ) {
6464 this . setState ( { modalIsOpen : true } ) ;
65- SLDSModalTrigger . open ( this . getModalConfig ( ) ) ;
65+ // SLDSModalTrigger.open(this.getModalConfig());
6666 } ,
6767
6868 closeModal ( ) {
@@ -73,10 +73,6 @@ module.exports = React.createClass( {
7373 this . closeModal ( ) ;
7474 } ,
7575
76- handleModalCancel ( ) {
77- console . log ( '!!! handleModalCancel !!!' ) ;
78- } ,
79-
8076 getModalContent ( ) {
8177 return < div >
8278 < p > Sit nulla est ex deserunt exercitation anim occaecat. Nostrud ullamco deserunt aute id consequat veniam incididunt duis in sint irure nisi. Mollit officia cillum Lorem ullamco minim nostrud elit officia tempor esse quis. Cillum sunt ad dolore
@@ -127,20 +123,18 @@ module.exports = React.createClass( {
127123 </ div > ;
128124 } ,
129125
130- getModalConfig ( returnFocusToElement ) {
131- return ( {
132- title :< span > Super Stuff</ span > ,
133- content : < div >
134- { this . getModalContent ( ) }
135-
136126
137- </ div > ,
138- footer :[
139- < button className = 'slds-button slds-button--neutral' onClick = { this . handleModalCancel } > Cancel</ button > ,
140- < button className = 'slds-button slds-button--neutral slds-button--brand' onClick = { this . handleSubmitModal } > Save</ button >
141- ] ,
142- returnFocusTo : returnFocusToElement
143- } ) ;
127+ renderModal ( ) {
128+ return < SLDSModal
129+ isOpen = { this . state . modalIsOpen }
130+ title = { < span > Super Stuff</ span > }
131+ footer = { [
132+ < button className = 'slds-button slds-button--neutral' onClick = { this . closeModal } > Cancel</ button > ,
133+ < button className = 'slds-button slds-button--neutral slds-button--brand' onClick = { this . handleSubmitModal } > Save</ button >
134+ ] }
135+ onRequestClose = { this . closeModal } >
136+ { this . getModalContent ( ) }
137+ </ SLDSModal > ;
144138 } ,
145139
146140 render ( ) {
@@ -159,11 +153,10 @@ module.exports = React.createClass( {
159153*/ }
160154
161155 < div className = 'slds-p-vertical--large' >
162- < SLDSButton flavor = 'brand' onClick = { this . handleOpenModalClick } >
156+ < SLDSButton flavor = 'brand' onClick = { this . openModal } >
163157 Open Modal
164158 </ SLDSButton >
165-
166-
159+ { this . renderModal ( ) }
167160 </ div >
168161 </ div >
169162
0 commit comments