├── .gitignore ├── src ├── index.js ├── utils │ └── index.js └── Touchable.js ├── example └── react-native-snackbar-component-demo │ ├── babel.config.js │ ├── assets │ ├── icon.png │ └── splash.png │ ├── .expo-shared │ └── assets.json │ ├── .gitignore │ ├── metro.config.js │ ├── package.json │ ├── app.json │ └── App.js ├── .eslintrc.json ├── .github └── workflows │ └── npmpublish.yml ├── LICENSE ├── package.json ├── README.md └── index.js /.gitignore: -------------------------------------------------------------------------------- 1 | /npm-debug.log 2 | node_modules/ 3 | .idea/ 4 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line import/prefer-default-export 2 | export { default as Touchable } from './Touchable'; 3 | -------------------------------------------------------------------------------- /example/react-native-snackbar-component-demo/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | api.cache(true); 3 | return { 4 | presets: ['babel-preset-expo'], 5 | }; 6 | }; 7 | -------------------------------------------------------------------------------- /example/react-native-snackbar-component-demo/assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sidevesh/react-native-snackbar-component/HEAD/example/react-native-snackbar-component-demo/assets/icon.png -------------------------------------------------------------------------------- /example/react-native-snackbar-component-demo/assets/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sidevesh/react-native-snackbar-component/HEAD/example/react-native-snackbar-component-demo/assets/splash.png -------------------------------------------------------------------------------- /example/react-native-snackbar-component-demo/.expo-shared/assets.json: -------------------------------------------------------------------------------- 1 | { 2 | "f9155ac790fd02fadcdeca367b02581c04a353aa6d5aa84409a59f6804c87acd": true, 3 | "89ed26367cdb9b771858e026f2eb95bfdb90e5ae943e716575327ec325f39c44": true 4 | } -------------------------------------------------------------------------------- /example/react-native-snackbar-component-demo/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/**/* 2 | .expo/* 3 | npm-debug.* 4 | *.jks 5 | *.p8 6 | *.p12 7 | *.key 8 | *.mobileprovision 9 | *.orig.* 10 | web-build/ 11 | web-report/ 12 | 13 | # macOS 14 | .DS_Store 15 | -------------------------------------------------------------------------------- /src/utils/index.js: -------------------------------------------------------------------------------- 1 | import { Platform } from 'react-native'; 2 | 3 | const { 4 | Version, 5 | OS, 6 | } = Platform; 7 | 8 | export const IS_ANDROID = OS === 'android'; 9 | export const IS_LT_LOLLIPOP = Version < 21; 10 | export const noop = () => {}; 11 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "extends": "airbnb", 4 | "rules": { 5 | "no-confusing-arrow": "off", 6 | "no-shadow": "off", 7 | "no-param-reassign": "off", 8 | "import/no-unresolved": "off", 9 | "import/extensions": "off", 10 | "import/no-extraneous-dependencies": "off", 11 | "react/jsx-filename-extension": "off", 12 | "react/sort-comp": "off", 13 | "no-use-before-define": "off", 14 | "react/destructuring-assignment": "off", 15 | "jsx-a11y/img-has-alt": "off" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /example/react-native-snackbar-component-demo/metro.config.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const getDevPaths = require('get-dev-paths'); 4 | 5 | const projectRoot = __dirname; 6 | module.exports = { 7 | resolver: { 8 | extraNodeModules: { 9 | react: path.resolve(__dirname, 'node_modules/react'), 10 | 'react-native': path.resolve(__dirname, 'node_modules/react-native'), 11 | }, 12 | }, 13 | // Old way 14 | // eslint-disable-next-line max-len 15 | // getProjectRoots: () => Array.from(new Set(getDevPaths(projectRoot).map($ => fs.realpathSync($)))), 16 | // New way 17 | watchFolders: Array.from( 18 | new Set(getDevPaths(projectRoot).map($ => fs.realpathSync($))), 19 | ), 20 | }; 21 | -------------------------------------------------------------------------------- /example/react-native-snackbar-component-demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "node_modules/expo/AppEntry.js", 3 | "scripts": { 4 | "start": "expo start", 5 | "android": "expo start --android", 6 | "ios": "expo start --ios", 7 | "web": "expo start --web", 8 | "eject": "expo eject" 9 | }, 10 | "dependencies": { 11 | "expo": "~49.0.16", 12 | "react": "~16.9.0", 13 | "react-dom": "~16.9.0", 14 | "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz", 15 | "react-native-snackbar-component": "file:../..", 16 | "react-native-web": "~0.11.7" 17 | }, 18 | "devDependencies": { 19 | "@babel/core": "^7.0.0", 20 | "babel-preset-expo": "~9.5.2", 21 | "get-dev-paths": "^0.1.1" 22 | }, 23 | "private": true 24 | } 25 | -------------------------------------------------------------------------------- /example/react-native-snackbar-component-demo/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "name": "Snackbar demo", 4 | "slug": "react-native-snackbar-component-demo", 5 | "privacy": "public", 6 | "sdkVersion": "36.0.0", 7 | "packagerOpts": { 8 | "config": "metro.config.js" 9 | }, 10 | "platforms": [ 11 | "ios", 12 | "android", 13 | "web" 14 | ], 15 | "version": "1.0.0", 16 | "orientation": "portrait", 17 | "icon": "./assets/icon.png", 18 | "splash": { 19 | "image": "./assets/splash.png", 20 | "resizeMode": "contain", 21 | "backgroundColor": "#ffffff" 22 | }, 23 | "updates": { 24 | "fallbackToCacheTimeout": 0 25 | }, 26 | "assetBundlePatterns": [ 27 | "**/*" 28 | ], 29 | "ios": { 30 | "supportsTablet": true 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /.github/workflows/npmpublish.yml: -------------------------------------------------------------------------------- 1 | name: NPM Publish 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | npm-publish: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout code 13 | uses: actions/checkout@v1 14 | - name: Setup node 15 | uses: actions/setup-node@v1 16 | with: 17 | node-version: 10 18 | registry-url: https://registry.npmjs.org/ 19 | - name: Install dependencies 20 | run: npm install 21 | - name: Publish package 22 | run: | 23 | echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc 24 | LATEST=`npm view . version` 25 | CURRENT=`cat package.json | jq -r .version` 26 | if [ "$LATEST" != "$CURRENT" ] 27 | then 28 | npm publish 29 | fi 30 | -------------------------------------------------------------------------------- /example/react-native-snackbar-component-demo/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { 3 | StyleSheet, 4 | View, 5 | Button, 6 | } from 'react-native'; 7 | import Snackbar from 'react-native-snackbar-component'; 8 | 9 | export default function App() { 10 | const [isVisible, setIsVisible] = React.useState(false); 11 | return ( 12 | 13 |