itworx-hub-modal
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -27,6 +27,7 @@ import React from "react"; | ||
headerAction={<button>Hi</button>} | ||
headerTitle={<button>Hi</button>} | ||
headerTitle="Hi" | ||
headerAside={<button>Hi</button>} | ||
footerAction={<button>Hi</button>} | ||
footerAside={<button>Hi</button>} | ||
headerClose | ||
centered | ||
@@ -38,2 +39,5 @@ fullHeight | ||
info | ||
small | ||
xsmall | ||
large | ||
> | ||
@@ -40,0 +44,0 @@ <p>Fixture ain't afraid of JSX</p> |
import React from "react"; | ||
import propTypes from "prop-types"; | ||
import PropTypes from "prop-types"; | ||
import ReactDOM from "react-dom"; | ||
@@ -115,2 +115,4 @@ import noScroll from "no-scroll"; | ||
footerAside: actionAside, | ||
closeOnEsc, | ||
closeOnOverlayClick, | ||
centered, | ||
@@ -123,8 +125,12 @@ fullHeight, | ||
open, | ||
small, | ||
xsmall, | ||
large, | ||
onCloseModal | ||
} = this.props; | ||
const isMobile = this.state.width <= 760; | ||
return open ? ( | ||
<div | ||
onClick={this.HandleClose} | ||
onClick={closeOnOverlayClick ? this.HandleClose : null} | ||
className={ | ||
@@ -135,6 +141,6 @@ fullHeightMobile && isMobile && !close | ||
} | ||
onMouseDown={this.onClickOverlay} | ||
onMouseDown={closeOnEsc ? this.onClickOverlay : null} | ||
> | ||
<div | ||
className={ | ||
className={`${ | ||
fullHeightMobile && isMobile && !close | ||
@@ -147,3 +153,11 @@ ? !close | ||
: centered ? "HubModal HubModal--Centered" : "HubModal" | ||
} | ||
} ${ | ||
close | ||
? large | ||
? "HubModal--large" | ||
: small | ||
? "HubModal--small" | ||
: xsmall ? "HubModal--xsmall" : "HubModal--medium" | ||
: null | ||
}`} | ||
> | ||
@@ -155,5 +169,9 @@ {icon || title || aside ? ( | ||
) : null} | ||
<div className="HubModal__Header__Content"> | ||
{icon ? icon : null} {title ? title : null} | ||
</div> | ||
{icon || title ? ( | ||
<div className="HubModal__Header__Content"> | ||
<h4> | ||
{icon ? icon : null} {title ? title : null} | ||
</h4> | ||
</div> | ||
) : null} | ||
{aside && (isMobile ? (close ? false : true) : false) ? ( | ||
@@ -188,3 +206,3 @@ <div className="HubModal__Header__Aside">{aside}</div> | ||
alert | ||
? "HubModal__Footer HubModal__Footer--aside" | ||
? "HubModal__Footer HubModal__Footer--alert" | ||
: info | ||
@@ -209,19 +227,15 @@ ? "HubModal__Footer HubModal__Footer--centered" | ||
// HubModal.propTypes = { | ||
// closeOnEsc: PropTypes.bool, | ||
// closeOnOverlayClick: PropTypes.bool, | ||
// onClose: PropTypes.func.isRequired, | ||
// open: PropTypes.bool.isRequired, | ||
// children: PropTypes.node, | ||
// little: PropTypes.bool, | ||
// showCloseIcon: PropTypes.bool | ||
// }; | ||
HubModal.propTypes = { | ||
closeOnEsc: PropTypes.bool, | ||
closeOnOverlayClick: PropTypes.bool, | ||
onCloseModal: PropTypes.func.isRequired, | ||
open: PropTypes.bool.isRequired, | ||
children: PropTypes.node | ||
}; | ||
// HubModal.defaultProps = { | ||
// closeOnEsc: true, | ||
// closeOnOverlayClick: true, | ||
// showCloseIcon: true, | ||
// children: null, | ||
// little: false | ||
// }; | ||
HubModal.defaultProps = { | ||
closeOnEsc: true, | ||
closeOnOverlayClick: true, | ||
children: null | ||
}; | ||
export default HubModal; |
{ | ||
"name": "itworx-hub-modal", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -83,3 +83,10 @@ const webpack = require("webpack"); | ||
splitChunks: { | ||
chunks: "all" | ||
cacheGroups: { | ||
styles: { | ||
name: "styles", | ||
test: /\.css$/, | ||
chunks: "all", | ||
enforce: true | ||
} | ||
} | ||
} | ||
@@ -86,0 +93,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2459743
24774