Skip to content

Commit dd162d2

Browse files
authored
React Modal v3 (#4)
* Deprecate "disableOverlay" prop and replace it with "disableOverlayClick" * Integrate Webpack 4, Babel 7 and Styleguidist * Bump to 3.0.0 * Update the code to use the `React.createRef()` API introduced in React 16.3 * Remove unused parameter * Update README.md * Update license year to 2019
1 parent 5d45dbc commit dd162d2

28 files changed

+747
-28184
lines changed

.babelrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class ModalWrapper extends PureComponent {
105105
static propTypes = {
106106
...Modal.propTypes
107107
};
108+
108109
static defaultProps = {
109110
...Modal.defaultProps
110111
};
@@ -118,12 +119,15 @@ class ModalWrapper extends PureComponent {
118119
}
119120
}
120121
}
122+
121123
componentDidMount() {
122124
this.changeBodyStyle();
123125
}
126+
124127
componentWillUnmount() {
125128
this.restoreBodyStyle();
126129
}
130+
127131
changeBodyStyle() {
128132
if (bodyStyle) {
129133
return;
@@ -135,13 +139,15 @@ class ModalWrapper extends PureComponent {
135139
};
136140
body.style.overflowY = 'hidden';
137141
}
142+
138143
restoreBodyStyle() {
139144
if (bodyStyle) {
140145
const body = document.querySelector('body');
141146
body.style.overflowY = bodyStyle.overflowY;
142147
bodyStyle = null;
143148
}
144149
}
150+
145151
render() {
146152
const { onClose, ...props } = this.props;
147153

@@ -177,7 +183,7 @@ onClose | Function | | A callback fired on clicking the overlay or the close but
177183
show | Boolean | true | Whether the modal is visible.
178184
showCloseButton | Boolean | true | Whether the close button (x) is visible.
179185
showOverlay | Boolean | true | Display an overlay in the background. Defaults to `true`.
180-
disableOverlay | Boolean | false | Don't close the modal on clicking the overlay. Defaults to `false`.
186+
disableOverlayClick | Boolean | false | Don't close the modal on clicking the overlay. Defaults to `false`.
181187
overlayClassName | String | | className to assign to modal overlay.
182188
overlayStyle | Object | | style to assign to modal overlay.
183189
size | String | '' | One of: 'xs', 'sm', 'md', 'lg', 'extra-small', 'small', 'medium', 'large', or an empty string. Defaults to empty string that will automatically resize to fit contents.

babel.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
extends: '@trendmicro/babel-config',
3+
presets: [
4+
'@babel/preset-env',
5+
'@babel/preset-react'
6+
]
7+
};

dist/react-modal.css

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-modal.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-modal.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/4be67fb1948530c73d9a55b1736d6d7f.svg

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/build/1.690ec258.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)