{"_id":"@anteniyus/message-bar","_rev":"1-f78e22b7c26dba13335664a5beae1fac","name":"@anteniyus/message-bar","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@anteniyus/message-bar","version":"1.0.0","description":"Simple Material-UI whole Project Snackbar","author":{"name":"Reza"},"license":"MIT","repository":{"type":"git","url":"Reza/@anteniyus/message-bar"},"main":"dist/index.js","module":"dist/index.modern.js","source":"src/index.js","engines":{"node":">=10"},"scripts":{"build":"microbundle-crl --no-compress --format modern,cjs","start":"microbundle-crl watch --no-compress --format modern,cjs","prepare":"run-s build","test":"run-s test:unit test:lint test:build","test:build":"run-s build","test:lint":"eslint .","test:unit":"cross-env CI=1 react-scripts test --env=jsdom","test:watch":"react-scripts test --env=jsdom","predeploy":"cd example && npm install && npm run build","deploy":"gh-pages -d example/build"},"peerDependencies":{"react":"^16.0.0"},"devDependencies":{"microbundle-crl":"^0.13.10","babel-eslint":"^10.0.3","cross-env":"^7.0.2","eslint":"^6.8.0","eslint-config-prettier":"^6.7.0","eslint-config-standard":"^14.1.0","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.18.2","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.1","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.17.0","eslint-plugin-standard":"^4.0.1","gh-pages":"^2.2.0","npm-run-all":"^4.1.5","prettier":"^2.0.4","react":"^16.13.1","react-dom":"^16.13.1","react-scripts":"^3.4.1"},"dependencies":{"@material-ui/core":"^4.11.0","@material-ui/icons":"^4.9.1","react-redux":"^7.2.0","redux":"^4.0.5","redux-thunk":"^2.3.0"},"gitHead":"382bf6a2ae57c0fb933367b1e0fade6c7218296b","_id":"@anteniyus/message-bar@1.0.0","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-MC1c4hNPB3Q4qivOGuu/k6n+t1H1cuABdHCbXMEHatzWUQDxHJYdEXUFymLFbu8CLoZ4+Q5MdFWF0jK5I8kyuw==","shasum":"ae33146afd9d99a31134a09f98a533ca879c63bf","tarball":"https://registry.npmjs.org/@anteniyus/message-bar/-/message-bar-1.0.0.tgz","fileCount":7,"unpackedSize":277775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcF26CRA9TVsSAnZWagAAH8wP/3FZ77rxQjPa6hDzo1c/\nDx11tpyLtTcEHROSPUEYSnqjxEE8OzQgxWof56vcpdCsCKJpQuL5rhW79qxI\nJm86Yya8wSECbDCiiLPwkGJ1zipNeP/UmfXNaZYan42Oln8w2MJTD+YSZdUE\nDm1KmDqAWTA9TWBeYIjoamcJ315JnzKNn31kk0zOE38tQKYqFRlTQ6EFtZCe\nhjuVhnzuhcIMAoxohMntRwbY/7eqV4n/1iIx3iiUw2UMbvIrQeERroXOnlPd\nc0NdTgkUhMVHKVSd4gurwTWLHOIKj+vm1Mgz1mu99AFfkq8O/ABIpKZNqnM0\n5efcq6hluOmQsR8YZfGcEmEO37GRr7GyeieCPIOJJVKTi30hUX3wlelGBEaa\nrlj6NGXi1yTSa/8gRQ4VPMT3zEqbnfoRG5TmYmI4UxIewGEih0+EBfo/uy2Y\n0x45OOIGP6NsQGTPeCLcIpWbB7H9AR4HT4ed73Zh6+HnBiHzrIuAf/djokQ7\n23oev6yi9BFvaiqd12l95CWEA/jvjBAhGCeVcfRFesxwbJOUJoKXx4la3/gs\nbcg173u6eTAS21bAhA8rfdPeDoyu5m/638HEgywhxujBzBizBVPdy4vdoRse\nkj03NCG5+pvGR91DmOvO4t+QODAjspQf0F7NCntuALhMHUGuHeuShg60gZW5\nqipX\r\n=dvgg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCybKXNQn4LzMH3fDiGhRKKYFQmxgMjv4n1WkyAvvZxlwIhANL/0/hBT1lZRdxg9TINXuUhUItd+DpSmLuKSfvwctzb"}]},"maintainers":[{"name":"anteniyus","email":"development.rezasajadi@gmail.com"}],"_npmUser":{"name":"anteniyus","email":"development.rezasajadi@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/message-bar_1.0.0_1601199546030_0.48667198670821543"},"_hasShrinkwrap":false}},"time":{"created":"2020-09-27T09:39:05.980Z","1.0.0":"2020-09-27T09:39:06.182Z","modified":"2022-04-04T14:21:21.995Z"},"maintainers":[{"name":"anteniyus","email":"development.rezasajadi@gmail.com"}],"description":"Simple Material-UI whole Project Snackbar","repository":{"type":"git","url":"Reza/@anteniyus/message-bar"},"author":{"name":"Reza"},"license":"MIT","readme":"# @anteniyus/message-bar\n\n> Simple Material-UI whole Project Snackbar\n\n[![NPM](https://img.shields.io/npm/v/@anteniyus/message-bar.svg)](https://www.npmjs.com/package/@anteniyus/message-bar) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n## Install\n\n```bash\nnpm install --save @anteniyus/message-bar\n```\n\n## Usage\n\n> First create redux store and import snackbarReducer in your index.js file:\n```jsx\nimport { createStore, applyMiddleware } from 'redux';\nimport snackbarReducer from './components/Snackbar/SnackbarReducer';\n\nconst store = createStore(snackbarReducer, applyMiddleware(thunk));\n```\n> Then wrap your return statement with Provider and add Snackbar component:\n```jsx\nimport { createStore, applyMiddleware } from 'redux';\nimport snackbarReducer from './components/Snackbar/SnackbarReducer';\nimport { Provider } from 'react-redux'; /* Add this */\n\nconst store = createStore(snackbarReducer, applyMiddleware(thunk));\n\nexport const ExampleComponent = () => {\n  return (\n    <Provider store={store}> {/* Add this */}\n      <Snackbar /> {/* Add this */}\n      ... //Other stuff\n    </Provider> /* Add this */\n  )\n}\n```\n\n>After that in any other components you want to show a message using snackbar you must wrap your component with **SnackbarWrapper**, and use *this.props.showSnackbar('your message', variant)* to show message to user, also variant is one of ['error', 'info', 'success', 'warning'].\n\n```jsx\nimport React, { Component } from 'react';\nimport SnackbarWrapper from './components/Snackbar/SnackbarWrapper';\n\nclass General extends Component {\n  constructor(props) {\n    super(props);\n  }\n\n  render() {\n    return (\n      <button\n        onClick={() => {\n          this.props.showSnackbar('This is a sample message', 'error');\n        }}\n      >\n        Click me to show a message bar\n      </button>\n    );\n  }\n}\n\nexport default SnackbarWrapper(General)\n\n```\n\n```jsx\nimport React, { Component } from 'react'\n\nimport General from './General'\n\nclass Example extends Component {\n  render() {\n    return <General />\n  }\n}\n```\n\n## License\n\nMIT © [Reza](https://github.com/Reza)\n","readmeFilename":"README.md"}