├── .eslintignore ├── .gitignore ├── .npmignore ├── .travis.yml ├── LICENSE ├── README.md ├── config └── webpack.js ├── demo ├── index.html └── index.js ├── lib └── index.js ├── package.json ├── runfile.js ├── src ├── index.js ├── index.test.js └── styles.js └── style.css /.eslintignore: -------------------------------------------------------------------------------- 1 | lib -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Don't check auto-generated stuff into git 2 | node_modules 3 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .idea 2 | node_modules 3 | lib -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | 2 | language: node_js 3 | node_js: 4 | - '6.3' 5 | install: 6 | - npm install 7 | - npm install -g runjs 8 | script: 9 | - run test 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Paweł Gałązka 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React PopUps! :sheep: 2 | A very simple react component that allows you to wrap your content in a modal window and control its visibility. 3 | 4 | First you need to install and import the component 5 | 6 | * `npm install https://github.com/Tim152/react-popups.git` 7 | * `import Popup from 'react-popups';` 8 | 9 | ### Component can be: 10 | * Controlled (manage by props) 11 | * Uncontrolled (manage by state) 12 | 13 | ### Example Controlled: 14 | The controlling component does not have its own button, you need to create it and manage the `isVisible` prop 15 | ```javascript 16 | //JS 17 | changePopupState() { 18 | this.setState({ popupIsVisible: !this.state.popupIsVisible }); 19 | } 20 | 21 | //JSX 22 |