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

Commit 7243019

Browse files
committed
Nearing something that moves
1 parent 42abcdc commit 7243019

26 files changed

+252
-481
lines changed

.eslintrc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
{
22
"parser": "babel-eslint",
3-
"env": {
4-
"browser": true,
5-
"node": true
6-
},
7-
"extends": "airbnb",
3+
"extends": "blue-hour",
84
"rules": {
9-
"react/sort-comp": 0,
10-
"react/jsx-indent": [1, 4],
11-
"react/jsx-indent-props": [1, 4]
5+
"react/prefer-es6-class": 0
126
}
137
}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ example/dist
1616

1717
# Build directories (Will be preserved by npm)
1818
dist
19-
lib
19+
build

example/src/standalone.html

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

package.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
"version": "3.0.0",
44
"description": "A lightbox component for React.js",
55
"scripts": {
6-
"start": "webpack-dev-server",
6+
"start": "cross-env NODE_ENV=development webpack-dev-server --hot --inline --config webpack.config.dev.babel.js",
77
"test": "webpack",
8-
"clean": "rm -rf dist",
9-
"build": "npm run clean && webpack",
10-
"deploy": "npm run build && gh-pages -d dist",
8+
"lint": "eslint src",
9+
"clean": "rimraf dist",
10+
"clean:demo": "rimraf build",
11+
"build": "npm run lint && npm run clean && webpack --config webpack.config.production.babel.js",
12+
"build:demo": "npm run clean:demo && webpack --config webpack.config.demo.babel.js",
13+
"deploy": "webpack --config webpack.config.demo.babel.js && gh-pages -d examples",
1114
"prepublish": "npm run build"
1215
},
1316
"main": "lib/react-image-lightbox.js",
@@ -35,18 +38,23 @@
3538
"babel-plugin-transform-object-rest-spread": "^6.8.0",
3639
"babel-preset-es2015": "^6.9.0",
3740
"babel-preset-react": "^6.11.1",
41+
"babel-register": "^6.9.0",
42+
"cross-env": "^2.0.0",
3843
"css-loader": "^0.23.1",
3944
"eslint": "^2.9.0",
4045
"eslint-config-airbnb": "^9.0.1",
46+
"eslint-config-blue-hour": "0.0.1",
4147
"eslint-plugin-import": "^1.10.2",
4248
"eslint-plugin-jsx-a11y": "^1.5.5",
4349
"eslint-plugin-react": "^5.2.2",
4450
"gh-pages": "^0.11.0",
51+
"html-webpack-plugin": "^2.22.0",
4552
"node-sass": "^3.8.0",
4653
"postcss-loader": "^0.9.1",
4754
"react": "^15.2.0",
4855
"react-dom": "^15.2.0",
4956
"react-hot-loader": "^1.3.0",
57+
"rimraf": "^2.5.3",
5058
"sass-loader": "^4.0.0",
5159
"style-loader": "^0.13.1",
5260
"webpack": "^1.13.1",

server.js

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

src/Styles.js

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

src/Constant.js renamed to src/constant.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
// Constants file
2-
3-
'use strict';
4-
5-
var constants = {
1+
export default {
62
// Min image zoom level
73
MIN_ZOOM_LEVEL: 0,
84

@@ -20,6 +16,10 @@ var constants = {
2016

2117
// Used to judge the amount of vertical scroll needed to initiate a zoom action
2218
WHEEL_MOVE_Y_THRESHOLD: 1,
23-
};
2419

25-
module.exports = Object.freeze(constants);
20+
KEYS: {
21+
ESC: 27,
22+
LEFT_ARROW: 37,
23+
RIGHT_ARROW: 39,
24+
},
25+
};

0 commit comments

Comments
 (0)