Skip to content
This repository was archived by the owner on Jan 19, 2023. It is now read-only.

Commit 430f352

Browse files
committed
changes in packages.json, demo config, clean up code
1 parent 06d7516 commit 430f352

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
],
3131
"license": "MIT",
3232
"dependencies": {
33-
"isomorphic-style-loader": "^2.0.0",
3433
"react-modal": "^1.4.0"
3534
},
3635
"peerDependencies": {
@@ -66,7 +65,7 @@
6665
"react-hot-loader": "^1.3.0",
6766
"rimraf": "^2.5.3",
6867
"sass-loader": "^4.0.0",
69-
"style-loader": "^0.13.1",
68+
"isomorphic-style-loader": "^2.0.0",
7069
"webpack": "^1.13.1",
7170
"webpack-dev-server": "^1.14.1"
7271
},

src/react-image-lightbox.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ class ReactImageLightbox extends Component {
167167

168168
componentDidMount() {
169169
this.mounted = true;
170+
ReactImageLightbox.loadStyles();
170171
this.attachListeners();
171172

172173
this.loadAllImages();
@@ -1218,6 +1219,13 @@ class ReactImageLightbox extends Component {
12181219
};
12191220
}
12201221

1222+
static loadStyles() {
1223+
// Insert component styles
1224+
if (typeof window === 'object') {
1225+
styles._insertCss();
1226+
}
1227+
}
1228+
12211229
render() {
12221230
const {
12231231
animationDisabled,
@@ -1416,12 +1424,6 @@ class ReactImageLightbox extends Component {
14161424
},
14171425
};
14181426

1419-
// Insert component styles
1420-
if (typeof window === 'object') {
1421-
styles._insertCss();
1422-
}
1423-
1424-
14251427
// DEPRECATION NOTICE
14261428
// All unprefixed classes (listed below) will be removed in v4.0.0.
14271429
// Use their `ril-` prefixed alternatives instead.

webpack.config.demo.babel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = {
4040
{
4141
test: /\.scss$/,
4242
loaders: [
43-
'style-loader',
43+
'isomorphic-style-loader',
4444
'css-loader?modules&-autoprefixer&importLoaders=1&localIdentName=[local]___[hash:base64:5]',
4545
'postcss-loader',
4646
'sass-loader',

0 commit comments

Comments
 (0)