@@ -22,25 +22,25 @@ var _react = (typeof window !== "undefined" ? window['React'] : typeof global !=
2222
2323var _react2 = _interopRequireDefault ( _react ) ;
2424
25- var Slug = ( function ( _React$Component ) {
26- _inherits ( Slug , _React$Component ) ;
25+ var Modal = ( function ( _React$Component ) {
26+ _inherits ( Modal , _React$Component ) ;
2727
28- function Slug ( props ) {
29- _classCallCheck ( this , Slug ) ;
28+ function Modal ( props ) {
29+ _classCallCheck ( this , Modal ) ;
3030
31- _get ( Object . getPrototypeOf ( Slug . prototype ) , 'constructor' , this ) . call ( this ) ;
31+ _get ( Object . getPrototypeOf ( Modal . prototype ) , 'constructor' , this ) . call ( this ) ;
3232 var closeOnOuterClick = true ;
3333 if ( props . closeOnOuterClick === false ) closeOnOuterClick = false ;
3434
3535 this . state = {
36- display : 'none' ,
36+ display : false ,
3737 closeOnOuterClick : closeOnOuterClick
3838 } ;
3939 this . hide = this . hide . bind ( this ) ;
4040 this . hideOnOuterClick = this . hideOnOuterClick . bind ( this ) ;
4141 }
4242
43- _createClass ( Slug , [ {
43+ _createClass ( Modal , [ {
4444 key : 'hideOnOuterClick' ,
4545 value : function hideOnOuterClick ( event ) {
4646 if ( ! this . state . closeOnOuterClick ) return ;
@@ -50,32 +50,33 @@ var Slug = (function (_React$Component) {
5050 } , {
5151 key : 'hide' ,
5252 value : function hide ( ) {
53- this . setState ( { display : 'none' } ) ;
53+ this . setState ( { display : false } ) ;
5454 }
5555 } , {
5656 key : 'show' ,
5757 value : function show ( ) {
58- this . setState ( { display : 'block' } ) ;
58+ this . setState ( { display : true } ) ;
5959 }
6060 } , {
6161 key : 'render' ,
6262 value : function render ( ) {
63+ if ( ! this . state . display ) return null ;
6364 return _react2 [ 'default' ] . createElement (
6465 'div' ,
65- _extends ( { style : this . state } , this . props , { onClick : this . hideOnOuterClick , 'data-modal' : "true" } ) ,
66+ _extends ( { } , this . props , { onClick : this . hideOnOuterClick , 'data-modal' : "true" } ) ,
6667 _react2 [ 'default' ] . createElement (
6768 'div' ,
68- { style : this . state } ,
69+ null ,
6970 this . props . children
7071 )
7172 ) ;
7273 }
7374 } ] ) ;
7475
75- return Slug ;
76+ return Modal ;
7677} ) ( _react2 [ 'default' ] . Component ) ;
7778
78- exports [ 'default' ] = Slug ;
79+ exports [ 'default' ] = Modal ;
7980module . exports = exports [ 'default' ] ;
8081
8182} ) . call ( this , typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : { } )
0 commit comments