{"_id":"@damoness/react-native-navigation-drawer-extension","_rev":"4-5555805753bca58bc912f28fde0724dc","time":{"4.3.0":"2021-11-17T11:37:38.292Z","created":"2021-11-17T11:40:32.558Z","4.2.1":"2021-11-17T11:40:32.773Z","modified":"2022-04-05T02:39:12.373Z"},"name":"@damoness/react-native-navigation-drawer-extension","dist-tags":{"latest":"4.2.1"},"versions":{"4.2.1":{"name":"@damoness/react-native-navigation-drawer-extension","version":"4.2.1","description":"Drawer API built on top of wix react-native-navigation for iOS and Android.","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"test":"echo \"Error: no test specified\"","prepublishOnly":"pinst --disable","postpublish":"pinst --enable","pre-commit":"lint-staged","_postinstall":"husky install"},"repository":{"type":"git","url":"git+https://github.com/newbanker-damon/react-native-navigation-drawer.git"},"keywords":["wix","react-native-navigation","navigation","react-native","drawer","side-menu","ios","android","native","typescript"],"peerDependencies":{"react-native-navigation":">= 3.x"},"author":{"name":"Damon"},"license":"MIT","bugs":{"url":"https://github.com/newbanker-damon/react-native-navigation-drawer/issues"},"homepage":"https://github.com/newbanker-damon/react-native-navigation-drawer#readme","dependencies":{},"devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/react":"^16.9.1","@types/react-native":"^0.60.4","husky":"^6.0.0","lint-staged":"^11.0.0","pinst":"^2.1.6","prettier":"^2.0.4","react":"^16.9.0","react-native":"^0.62.3","react-native-navigation":"^6.4.0","semantic-release":"^17.4.3","typescript":"^3.9.9"},"gitHead":"aab05bbd2b263d61c89b1ad6aaa054b2fb4fe40c","_id":"@damoness/react-native-navigation-drawer-extension@4.2.1","_nodeVersion":"12.22.1","_npmVersion":"6.14.13","dist":{"integrity":"sha512-Zx2VXjfjT511VEYZabBsyUQb5u190+uEU1nnAS+1zp/bp/OotemC+b/tEnnue9X/LZx8QtzyNCtBJ7InsDTTJQ==","shasum":"9e040cb30ece4ccbedf1d0d498b50adce3635762","tarball":"https://registry.npmjs.org/@damoness/react-native-navigation-drawer-extension/-/react-native-navigation-drawer-extension-4.2.1.tgz","fileCount":11,"unpackedSize":51118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlOowCRA9TVsSAnZWagAA0oUQAJONCJDYCokB661wyShY\n+C4DdusMQg3zDQ2K0BeOcBSNxvc8e7aDB4Taf7KNn538ch6g15db/budSfUn\nj8LUDKdkaqR+4qrbRxG+bLYs8i2waAxkU3KanOPmg3psIYlJWLjKJGIGc652\nxBbFE6WttI2ngsJRfjgv0hXZUTj2wo3z/p43mC23L0xLaCffEVQ95d+C7/Lq\ngltUyD1Wla20GWSMkwZP0I44dnEL7cD+WKu27NGn25Fy883lNz9VKZ9gp+24\njRp44lcMvgeOBBmxB7rGuatdyBZ0FVCUdpDLcNQZDa2BVgZ23L9BuEjRzflz\nnBnaYHhbLrhYfMj2PisrYfuMrD5lGr7CH77qonQJO0xMFfht6gE1jFU3X2TZ\nNJW8FKSGCz3MkFKvSqPB0kHFDKbyaDVvTlV4PNodWW+Mm3vam2i+wTM6C622\nWKgVWPHwP/NTei1zYa2a3xU1Ni8xkHFEIvMrz8LxMGkYku7prmzbBp0wEgfB\n2tmka/gjCvgCuYGIhzj2UHP58Fc5B0kQJGdrYSWoKb/6V1Knhdv+LVB+E589\nCL8MoQuf1wK/C7/xA7H9KF5IBeflhVpN81BcgR9fJntppgwzgOBW3hynV0cX\n/JOrzpwwqB3kl1JzzyEtgzHsu97A6rz0dJ8OEI3ct9l84U+kwrHaUtIn+Bhd\nxweT\r\n=j01w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA2Puck82uj3qlb6XttITo7uaUA1scDQEs/BbwAaUtSfAiEA3IX3rqDwwPS6lq5VXTl5vukVS3wf0LSaVisH5kAstlY="}]},"_npmUser":{"name":"damoness","email":"qjwdcool@qq.com"},"directories":{},"maintainers":[{"name":"damoness","email":"qjwdcool@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-navigation-drawer-extension_4.2.1_1637149232610_0.9974151791265233"},"_hasShrinkwrap":false}},"maintainers":[{"name":"damoness","email":"qjwdcool@qq.com"}],"description":"Drawer API built on top of wix react-native-navigation for iOS and Android.","homepage":"https://github.com/newbanker-damon/react-native-navigation-drawer#readme","keywords":["wix","react-native-navigation","navigation","react-native","drawer","side-menu","ios","android","native","typescript"],"repository":{"type":"git","url":"git+https://github.com/newbanker-damon/react-native-navigation-drawer.git"},"author":{"name":"Damon"},"bugs":{"url":"https://github.com/newbanker-damon/react-native-navigation-drawer/issues"},"license":"MIT","readme":"<h2 align=\"center\">\n  <img src=\"https://user-images.githubusercontent.com/7014073/98849326-cca07f80-2431-11eb-82dd-fd2b4e52be44.png?s=300\" width=\"325\" /><br/>\n  React Native Navigation Drawer Extension\n</h2>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/react-native-navigation-drawer-extension\" rel=\"nofollow\">\n  <img src=\"https://img.shields.io/npm/v/react-native-navigation-drawer-extension.svg?style=flat-square\" alt=\"version\" style=\"max-width:100%;\" />\n  </a>\n  <a href=\"https://www.npmjs.com/package/react-native-navigation-drawer-extension\" rel=\"nofollow\">\n  <img src=\"http://img.shields.io/npm/l/react-native-navigation-drawer-extension.svg?style=flat-square\" alt=\"license\" style=\"max-width:100%;\" />\n  </a>\n  <a href=\"https://www.npmjs.com/package/react-native-navigation-drawer-extension\" rel=\"nofollow\">\n    <img src=\"http://img.shields.io/npm/dt/react-native-navigation-drawer-extension.svg?style=flat-square\" alt=\"downloads\" style=\"max-width:100%;\" />\n  </a>\n</p>\n\n[React Native Navigation by Wix](https://wix.github.io/react-native-navigation/#/) does not offer an in-built solution for displaying a drawer on iOS. Their current side-menu has limited functionality on both iOS and Android. This is a drawer solution using showOverlay under the hood to display a drawer on iOS and Android.\n\nIf you are using React Native Navigation >= 3.0.0 then use version 3.x.x + of this library.\n\n<img align=\"left\" src=\"https://raw.githubusercontent.com/LukeBrandonFarrell/open-source-images/master/react-native-navigation-drawer-extension/left-drawer.gif\" width=\"48%\" />\n<img src=\"https://raw.githubusercontent.com/LukeBrandonFarrell/open-source-images/master/react-native-navigation-drawer-extension/bottom-drawer.gif\" width=\"48%\" />\n\n## Install\n\n```sh\n npm install react-native-navigation-drawer-extension --save\n```\n\nor\n\n```sh\n yarn add react-native-navigation-drawer-extension\n```\n\n## Usage\n\nYou need to register your drawer component with RNN. To do this use the register method and wrap your component in the RNNDrawer HOC.\n\n```js\nimport { Navigation } from \"react-native-navigation\";\nimport { RNNDrawer } from \"react-native-navigation-drawer-extension\";\n\n// register our drawer component with RNN\nNavigation.registerComponent(\"CustomDrawer\", () => RNNDrawer.create(CustomDrawer));\n```\n\nYou can then use the drawer by calling a custom method. The `showDrawer` method\nwill take a single parameter `options` identical to `showOverlay`.\n\n````js\nimport { RNNDrawer } from \"react-native-navigation-drawer-extension\";\n\nRNNDrawer.showDrawer({\n  component: {\n    name: \"CustomDrawer\",\n    passProps: {\n      animationOpenTime: 300,\n      animationCloseTime: 300,\n      direction: \"left\",\n      dismissWhenTouchOutside: true,\n      fadeOpacity: 0.6,\n      drawerScreenWidth: \"75%\" || 445, // Use relative to screen '%' or absolute\n      drawerScreenHeight: \"100%\" || 700,\n      style: { // Styles the drawer container, supports any react-native style\n        backgroundColor: \"red\",\n      },\n      parentComponentId: props.componentId, // Custom prop, will be available in your custom drawer component props\n    },\n  }\n});\n\nRNNDrawer.dismissDrawer();\n````\n\nTo navigate from the drawer you must pass the parent `componentId` and use that to navigate. e.g:\n\n```js\n// From drawer component\nNavigation.push(parentComponentId, {\n  component: {\n    name: \"CustomScreenFromDrawer\",\n  },\n});\n```\n\nThere's a complete and functional example at the `example` folder, with more thorough explanation on each method.\n\n#### Props\n\nThe props below are used to configure the drawer and are to be used in RNN `passProps:`. Any aditional\nprops will be passed to your custom drawer component.\n\n| Prop                | Type          | Optional  | Default | Description                                                                             |\n| ------------------- | ------------- | --------- | ------- | --------------------------------------------------------------------------------------- |\n| animationOpenTime   | float         | Yes       | 300     | Time in milliseconds to execute the drawer opening animation.                           |\n| animationCloseTime  | float         | Yes       | 300     | Time in milliseconds to execute the drawer closing animation.                           |\n| direction           | string        | Yes       | left    | Direction to open the collage, one of: [\"left\", \"right\", \"top\", \"bottom\"].              |\n| dismissWhenTouchOutside | bool      | Yes       | true    | Should the drawer be dismissed when a click is registered outside?                      |\n| fadeOpacity         | number        | Yes       | 0.6     | Opacity of the screen outside the drawer.                                               |\n| drawerScreenWidth   | number        | Yes       | 0.8     | 0 - 1, width of drawer in relation to the screen.                                       |\n| drawerScreenHeight  | number        | Yes       | 1       | 0 - 1, height of drawer in relation to the screen.                                      |                         \n| disableDragging     | boolean       | Yes       | false   | Whether you want to disable dragging of the drawer. Useful if you have ScrollView inside the drawer (addresses #62).|                         \n| disableSwiping      | boolean       | Yes       | false   | Whether you want to disable swiping gesture. Use it only in pair with disableDragging.|                         \n\n## SideMenuView\n\n<img src=\"https://raw.githubusercontent.com/LukeBrandonFarrell/open-source-images/master/react-native-navigation-drawer-extension/slide-drawer.gif\" width=\"30%\" />\n\nThe library also exposes a component which will allow you to open the drawer by either swiping the left or right gutter of the phone. This is achieved by using event listeners\nto communicate with the RNNDrawer HOC component. To enable this feature wrap your screen with the `SideMenuView` component. `<SideMenuView>` is just an enhanced `<View>` all props are passed down to `<View>`.\n\n```js\nimport { SideMenuView } from \"react-native-navigation-drawer-extension\";\n\n<SideMenuView\n  style={{ flex: 1 }}\n  drawerName={'CustomDrawer'}\n  direction={'right'}\n  passProps={{\n    animationOpenTime: 300,\n    animationCloseTime: 300,\n    dismissWhenTouchOutside: true,\n    fadeOpacity: 0.6,\n    drawerScreenWidth: '75%',\n    drawerScreenHeight: '100%',\n    parentComponentId: props.componentId,\n    style: {\n      backgroundColor: 'white', \n    },\n  }}\n  options={{\n    layout: {\n      componentBackgroundColor: 'transparent',\n    }\n >\n  {...}\n </SideMenuView>\n\n```\n\n#### Props\n\n| Prop                | Type          | Optional  | Default | Description                                                                             |\n| ------------------- | ------------- | --------- | ------- | --------------------------------------------------------------------------------------- |\n| style               | StyleProp<ViewStyle> | Yes |        | The style of the drawer container.                              |\n| drawerName          | string        | No        |         | The name of the drawer component.\n| direction           | string        | Yes       | left    | The direction to open the drawer, one of: [\"left\", \"right\"].\n| passProps           | object        | Yes       |         | The values passed to the drawer. See props in RNNDrawer above.\n| options             | Options       | Yes       |         | The options to configure properties of the React Native Navigation native screen. Refer to React Native Navigation's options object.\n| swipeSensitivity    | number        | Yes       | 0.2     | The sensitivity of the swipe to invoke each function.                                   |\n| sideMargin          | number        | Yes       | 15      | The size of the gutter for both sides.                                                  |\n| sideMarginLeft      | number        | Yes       |         | The size of the gutter for the left side.                                               |\n| sideMarginRight     | number        | Yes       |         | The size of the gutter for the right side.                                              |   \n\n## Contributors ✨\n  \n<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n  [![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tr>\n    <td align=\"center\"><a href=\"https://github.com/rodriigovieira\"><img src=\"https://avatars.githubusercontent.com/u/7014073?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Rodrigo Vieira</b></sub></a><br /><a href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/commits?author=rodriigovieira\" title=\"Code\">💻</a> <a href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/issues?q=author%3Arodriigovieira\" title=\"Bug reports\">🐛</a> <a href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/commits?author=rodriigovieira\" title=\"Documentation\">📖</a> <a href=\"#maintenance-rodriigovieira\" title=\"Maintenance\">🚧</a></td>\n    <td align=\"center\"><a href=\"https://discord.gg/QqTN6HqNTG\"><img src=\"https://avatars.githubusercontent.com/u/18139277?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Luke Brandon Farrell</b></sub></a><br /><a href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/commits?author=lukebrandonfarrell\" title=\"Code\">💻</a> <a href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/issues?q=author%3Alukebrandonfarrell\" title=\"Bug reports\">🐛</a> <a href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/commits?author=lukebrandonfarrell\" title=\"Documentation\">📖</a></td>\n    <td align=\"center\"><a href=\"https://github.com/CursedWizard\"><img src=\"https://avatars.githubusercontent.com/u/67508707?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>CyberFuntik</b></sub></a><br /><a href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/commits?author=CursedWizard\" title=\"Code\">💻</a> <a href=\"https://github.com/aspect-apps/react-native-navigation-drawer-extension/commits?author=CursedWizard\" title=\"Documentation\">📖</a></td>\n  </tr>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","readmeFilename":"README.md"}