├── example.gif ├── src ├── index.js └── index.android.js ├── .babelrc ├── circle.yml ├── .editorconfig ├── .gitignore ├── README.md └── package.json /example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnc-archive/react-native-drawer-layout-polyfill/HEAD/example.gif -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import DrawerLayout from 'react-native-drawer-layout'; 2 | 3 | export default DrawerLayout; 4 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "react-native" 4 | ], 5 | "plugins": [], 6 | "compact": "false" 7 | } 8 | -------------------------------------------------------------------------------- /src/index.android.js: -------------------------------------------------------------------------------- 1 | import { DrawerLayoutAndroid } from 'react-native'; 2 | 3 | export default DrawerLayoutAndroid; 4 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | node: 3 | version: v4.2.1 4 | 5 | dependencies: 6 | pre: 7 | - npm install 8 | 9 | cache_directories: 10 | - node_modules 11 | 12 | test: 13 | override: 14 | - npm test 15 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | end_of_line = lf 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # node.js 26 | # 27 | node_modules/ 28 | npm-debug.log 29 | dist/ 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-drawer-layout-polyfill [![CircleCI](https://circleci.com/gh/react-native-community/react-native-drawer-layout-polyfill/tree/master.svg?style=svg)](https://circleci.com/gh/react-native-community/react-native-drawer-layout-polyfill/tree/master) 2 | 3 | This is a polyfill for [React Natives `DrawerLayoutAndroid`](https://facebook.github.io/react-native/docs/drawerlayoutandroid.html), please refer to this documentation for the usage. 4 | 5 | ## Add it to your project 6 | 7 | 1. Run `npm install react-native-drawer-layout-polyfill --save` 8 | 2. Import the component by using one of these: 9 | - `var DrawerLayout = require('react-native-drawer-layout-polyfill');` 10 | - `import DrawerLayout from 'react-native-drawer-layout-polyfill';` 11 | 3. Follow the [DrawerLayoutAndroid](https://facebook.github.io/react-native/docs/drawerlayoutandroid.html#content) docs -- the API is the same. 12 | 13 | ## Demo 14 | 15 | ![](https://raw.githubusercontent.com/react-native-community/react-native-drawer-layout-polyfill/master/example.gif) 16 | 17 | ## Examples 18 | 19 | - [Normal usage](https://github.com/DanielMSchmidt/DrawerLayoutPolyfillExample) 20 | 21 | 22 | ## Restrictions 23 | 24 | - Currently, there is no support for setting the status bar color in iOS. If you know any workaround, we would be glad to see an idea or a PR. 25 | 26 | If you experience any further restrictions with other versions, please let us know. 27 | 28 | ## Release Notes 29 | 30 | ### 2.0 31 | 32 | - Update [`react-native-drawer-layout`](https://github.com/react-native-community/react-native-drawer-layout) to version 2.0, support for only for RN >= 0.35 33 | 34 | ### 1.0 35 | 36 | - Moved from [`react-native-drawer-layout`](https://github.com/react-native-community/react-native-drawer-layout) 37 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-drawer-layout-polyfill", 3 | "version": "2.0.0", 4 | "description": "A polyfill for React Natives DrawerLayoutAndroid", 5 | "main": "dist", 6 | "scripts": { 7 | "babel": "babel src --out-dir dist", 8 | "build": "npm run-script clear && npm run-script babel", 9 | "clear": "rm -rf dist/ && mkdir dist/", 10 | "prepublish": "npm run build", 11 | "test": "xo" 12 | }, 13 | "files": [ 14 | "dist/" 15 | ], 16 | "repository": { 17 | "type": "git", 18 | "url": "git@github.com:react-native-community/react-native-drawer-layout-polyfill.git" 19 | }, 20 | "author": "Daniel Schmidt (https://github.com/danielmschmidt)", 21 | "contributors": [], 22 | "xo": { 23 | "ignores": [ 24 | "dist/*" 25 | ], 26 | "esnext": true, 27 | "space": 2, 28 | "plugins": [ 29 | "react" 30 | ], 31 | "rules": { 32 | "babel/object-curly-spacing": [ 33 | 2, 34 | "always" 35 | ], 36 | "comma-dangle": [ 37 | 2, 38 | "always-multiline" 39 | ], 40 | "react/jsx-curly-spacing": 2, 41 | "strict": [ 42 | 2, 43 | "never" 44 | ], 45 | "no-use-before-define": 0, 46 | "one-var": [ 47 | 2, 48 | { 49 | "uninitialized": "always", 50 | "initialized": "never" 51 | } 52 | ], 53 | "react/no-set-state": 1, 54 | "react/prop-types": 2, 55 | "react/jsx-sort-prop-types": 2, 56 | "react/jsx-closing-bracket-location": [ 57 | 2, 58 | { 59 | "selfClosing": "after-props", 60 | "nonEmpty": "after-props" 61 | } 62 | ], 63 | "react/jsx-indent-props": [ 64 | 2, 65 | 2 66 | ], 67 | "react/self-closing-comp": 2 68 | } 69 | }, 70 | "keywords": [ 71 | "react", 72 | "react-native", 73 | "ios", 74 | "android", 75 | "drawer", 76 | "layout", 77 | "menu" 78 | ], 79 | "license": "MIT", 80 | "dependencies": { 81 | "react-native-drawer-layout": "2.0.0" 82 | }, 83 | "peerDependencies": { 84 | "react-native": ">= 0.35" 85 | }, 86 | "devDependencies": { 87 | "babel-cli": "^6.0.0", 88 | "babel-eslint": "^5.0.0-beta6", 89 | "babel-preset-react-native": "^1.8.0", 90 | "eslint": "^1.10.3", 91 | "eslint-config-xo": "^0.9.1", 92 | "eslint-plugin-babel": "^3.0.0", 93 | "eslint-plugin-no-empty-blocks": "0.0.2", 94 | "eslint-plugin-no-use-extend-native": "^0.3.3", 95 | "eslint-plugin-react": "^3.13.1", 96 | "xo": "^0.12.1" 97 | } 98 | } 99 | --------------------------------------------------------------------------------