├── .eslintignore ├── .npmignore ├── __mocks__ └── fileMock.js ├── .travis.yml ├── src ├── index.js ├── constant.js ├── util.js ├── style.css ├── __tests__ │ ├── react-image-lightbox.spec.js │ └── __snapshots__ │ │ └── react-image-lightbox.spec.js.snap └── lightbox-react.js ├── test-config ├── shim.js └── test-setup.js ├── examples └── cats │ ├── images │ ├── 1.jpg │ ├── 2.jpg │ ├── 3.jpg │ ├── 4.jpg │ ├── 1_thumb.jpg │ ├── 2_thumb.jpg │ ├── 3_thumb.jpg │ └── 4_thumb.jpg │ ├── index.html │ ├── components │ └── video.js │ ├── stylesheets │ ├── app.css │ └── vendor │ │ ├── github-light.css │ │ └── stylesheet.css │ └── index.js ├── .eslintrc.json ├── svg ├── left_arrow.svg ├── right_arrow.svg ├── x.svg ├── zoom_out.svg └── zoom_in.svg ├── .gitignore ├── .babelrc ├── LICENSE ├── index.d.ts ├── package.json ├── webpack.config.js └── README.md /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build 3 | dist 4 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | bower.json 2 | src/examples 3 | svg 4 | -------------------------------------------------------------------------------- /__mocks__/fileMock.js: -------------------------------------------------------------------------------- 1 | module.exports = 'test-file-stub'; 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 'node' 4 | script: 5 | - npm test 6 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import Lightbox from './lightbox-react'; 2 | 3 | export default Lightbox; 4 | -------------------------------------------------------------------------------- /test-config/shim.js: -------------------------------------------------------------------------------- 1 | global.requestAnimationFrame = callback => { 2 | setTimeout(callback, 0); 3 | }; 4 | -------------------------------------------------------------------------------- /examples/cats/images/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/treyhuffine/lightbox-react/HEAD/examples/cats/images/1.jpg -------------------------------------------------------------------------------- /examples/cats/images/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/treyhuffine/lightbox-react/HEAD/examples/cats/images/2.jpg -------------------------------------------------------------------------------- /examples/cats/images/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/treyhuffine/lightbox-react/HEAD/examples/cats/images/3.jpg -------------------------------------------------------------------------------- /examples/cats/images/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/treyhuffine/lightbox-react/HEAD/examples/cats/images/4.jpg -------------------------------------------------------------------------------- /examples/cats/images/1_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/treyhuffine/lightbox-react/HEAD/examples/cats/images/1_thumb.jpg -------------------------------------------------------------------------------- /examples/cats/images/2_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/treyhuffine/lightbox-react/HEAD/examples/cats/images/2_thumb.jpg -------------------------------------------------------------------------------- /examples/cats/images/3_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/treyhuffine/lightbox-react/HEAD/examples/cats/images/3_thumb.jpg -------------------------------------------------------------------------------- /examples/cats/images/4_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/treyhuffine/lightbox-react/HEAD/examples/cats/images/4_thumb.jpg -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["airbnb", "prettier", "prettier/react"], 3 | "env": { 4 | "jest": true 5 | }, 6 | "rules": { 7 | "react/jsx-filename-extension": 0 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /svg/left_arrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /svg/right_arrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test-config/test-setup.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-extraneous-dependencies */ 2 | import { configure } from 'enzyme'; 3 | import Adapter from 'enzyme-adapter-react-16'; 4 | 5 | configure({ adapter: new Adapter() }); 6 | -------------------------------------------------------------------------------- /svg/x.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /svg/zoom_out.svg: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | coverage 3 | npm-debug.log 4 | 5 | # Editor and other tmp files 6 | *.swp 7 | *.un~ 8 | *.iml 9 | *.ipr 10 | *.iws 11 | *.sublime-* 12 | .idea/ 13 | *.DS_Store 14 | 15 | # Build directories (Will be preserved by npm) 16 | dist 17 | build 18 | /style.css 19 | /style.css.map 20 | -------------------------------------------------------------------------------- /examples/cats/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
74 | .. not in the
75 | mood
76 | for games right now
77 |
78 | ...
79 |
80 | ...
81 |
82 | ...
83 |
84 | ...
85 |
86 | ...
87 |
88 | ...
89 |
90 | C'mon. Seriously.
91 |
227 |
228 | (imageSrc: string, srcType: string, errorEvent: object): void`Specified Error Message
; 288 | wrapper.setState({ 289 | loadErrorStatus: { mainSrc: true }, 290 | }); 291 | wrapper.setProps({ 292 | imageLoadErrorMessage, 293 | }); 294 | wrapper.update(); 295 | expect(wrapper.find('div.ril__errorContainer')).toContainReact( 296 | imageLoadErrorMessage 297 | ); 298 | }); 299 | }); 300 | -------------------------------------------------------------------------------- /src/__tests__/__snapshots__/react-image-lightbox.spec.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Snapshot Testing Lightbox renders properly" 1`] = ` 4 | , 38 | } 39 | } 40 | reactModalStyle={Object {}} 41 | toolbarButtons={null} 42 | wrapperClassName="" 43 | zoomInLabel="Zoom in" 44 | zoomOutLabel="Zoom out" 45 | > 46 | 51 | } 52 | ariaHideApp={true} 53 | bodyOpenClassName="ReactModal__Body--open" 54 | closeTimeoutMS={0} 55 | contentLabel="Lightbox" 56 | isOpen={true} 57 | onAfterOpen={[Function]} 58 | onRequestClose={[Function]} 59 | parentSelector={[Function]} 60 | portalClassName="ReactModalPortal" 61 | role="dialog" 62 | shouldCloseOnEsc={true} 63 | shouldCloseOnOverlayClick={true} 64 | shouldFocusAfterRender={true} 65 | shouldReturnFocusAfterClose={true} 66 | style={ 67 | Object { 68 | "content": Object { 69 | "backgroundColor": "transparent", 70 | "border": "none", 71 | "borderRadius": 0, 72 | "bottom": 0, 73 | "left": 0, 74 | "overflow": "hidden", 75 | "padding": 0, 76 | "right": 0, 77 | "top": 0, 78 | }, 79 | "overlay": Object { 80 | "backgroundColor": "transparent", 81 | "zIndex": 1000, 82 | }, 83 | } 84 | } 85 | > 86 |