Skip to content

Commit

Permalink
fix: fix android shadow issue
Browse files Browse the repository at this point in the history
fix: fix android shadow issue #4
  • Loading branch information
nithinpp69 authored Jul 18, 2022
2 parents a329017 + 9909ca4 commit 471f5a2
Show file tree
Hide file tree
Showing 21 changed files with 3,776 additions and 2,337 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
lib/
71 changes: 71 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"plugins": ["import"],
"extends": [
"plugin:@typescript-eslint/recommended",
"@react-native-community",
"prettier",
"plugin:import/typescript"
],
"rules": {
"quotes": [
"error",
"single",
{
"avoidEscape": true
}
],
"max-len": [
"error",
80
],
"@typescript-eslint/ban-ts-comment": 2,
"@typescript-eslint/no-explicit-any": 2,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/consistent-type-imports": 2,
"react/jsx-filename-extension": ["error", { "extensions": [".tsx"] }],
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react-native/no-unused-styles": 2,
"react-native/split-platform-components": 2,
"react-native/no-inline-styles": 0,
"react-native/no-color-literals": 0,
"react-native/no-raw-text": 0,
"import/no-extraneous-dependencies": 2,
"import/extensions": ["error", "never", { "svg": "always" }],
"import/order": ["error", {"newlines-between": "always"}],
"import/no-duplicates": 2,
"import/no-useless-path-segments": 2,
"import/no-cycle": [2, { "ignoreExternal": true }],
"import/prefer-default-export": 0,
"import/named": 0,
"import/namespace": 0,
"import/default": 0,
"import/no-named-as-default-member": 0,
"import/no-named-as-default": 0,
"import/no-unused-modules": 0,
"import/no-deprecated": 0,
"@typescript-eslint/indent": 0,
"import/no-anonymous-default-export": 2,
"import/no-default-export": 0,
"react-hooks/rules-of-hooks": 2,
"react-hooks/exhaustive-deps": ["error", { "additionalHooks": "(useMemoOne)" }],
"jest/no-identical-title": 2,
"jest/valid-expect": 2,
"camelcase": 2,
"prefer-destructuring": 2,
"no-nested-ternary": 2,
"comma-dangle": 0,
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-shadow": ["error"],
"no-shadow": "off",
"curly": "error",
"semi": ["error", "always"],
"no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }],
"no-use-before-define": ["error", {
"functions": true,
"classes": true,
"variables": true,
"allowNamedExports": false
}]
}
}
29 changes: 0 additions & 29 deletions .eslintrc.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: "📚 release"
name: "🚀 release"
on:
push:
branches:
- main

jobs:
release:
name: 📚 release
name: 🚀 release
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
node-version: 14
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: yarn
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "🧪 unit-test"
on:
pull_request:
branches:
- main

jobs:
release:
name: 🧪 unit-test
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: yarn
- name: Test
run: npm test
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ yarn-error.log
.vscode/

# generated by bob
lib/
lib/
*.zip
*.tgz
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn ci
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ tmp

# Examples (If applicable to your project)
examples
/coverage
/coverage
*.zip
*.tgz
16 changes: 16 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"arrowParens": "avoid",
"bracketSameLine": true,
"bracketSpacing": false,
"endOfLine": "lf",
"insertPragma": false,
"jsxSingleQuote": false,
"parser": "babel",
"proseWrap": "preserve",
"quoteProps": "as-needed",
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"useTabs": false,
"tabWidth": 2
}
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Build: 🏠 `1.0.1` - react-native-switch-toggles

---
- fix: fix android shadow issue

### Build: 🏠 `1.0.0` - react-native-switch-toggles

---
- chore: added build setup with react-native-builder-bob.
- chore: publish compiled source to npm
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ const [isEnabled, setIsEnabled] = React.useState(false);
## Props
| Prop | Description | Type | Default Value | Required |
| :--------------------------:|:--------------------------------------------------------------------------------------|:-----------------------------:|:--------------------------:|:---------:|
| size | size of the switch component | Number | 25 | true |
| value | switch on/off state value | Boolean | | true |
| onChange | callback on switch value change | Function | (value: boolean) => void; | true |
| size | size of the switch component | Number | 25 | false |
| disabled | enable/disable switch | Boolean | false | false |
| activeTrackColor | track color when switch value is true | String | "rgba(255,255,255,0.6)" | false |
| inactiveTrackColor | track color when switch value is false | String | "rgba(0,0,0,0.2)" | false |
Expand Down
4 changes: 4 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* eslint-disable no-undef */
jest.mock('react-native-reanimated', () =>
jest.requireActual('./node_modules/react-native-reanimated/mock'),
);
82 changes: 56 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
{
"name": "react-native-switch-toggles",
"version": "1.0.0",
"version": "1.0.1",
"description": "React Native customizable switch component",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/index.d.ts",
"react-native": "src/index",
"files": [
"src",
"lib"
"lib",
"!**/__tests__"
],
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint --color --ext .js --fix src/",
"typescript": "tsc --skipLibCheck --noEmit",
"test": "jest",
"lint": "eslint --ext .ts,.tsx . --max-warnings 0",
"lint:fix": "eslint --ext .ts,.tsx . --fix",
"tsc": "tsc",
"ci": "yarn lint && yarn tsc",
"build": "bob build",
"prepare": "yarn build"
"prepare": "yarn build && husky install"
},
"repository": {
"name": "GitHub",
Expand All @@ -35,36 +38,37 @@
},
"homepage": "https://github.com/nithinpp69/react-native-switch-toggles.git",
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/core": "^7.18.5",
"@babel/preset-env": "^7.10.2",
"@babel/preset-react": "^7.10.1",
"@babel/runtime": "^7.11.2",
"@react-native-community/eslint-config": "^2.0.0",
"@types/react-native": "^0.64.13",
"@babel/runtime": "^7.18.3",
"@react-native-community/eslint-config": "^3.0.3",
"@testing-library/react-native": "^10.1.1",
"@types/jest": "^28.1.3",
"@types/react-native": "^0.69.1",
"@types/react-test-renderer": "^18.0.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^28.1.0",
"babel-plugin-module-resolver": "^4.1.0",
"babel-plugin-transform-export-extensions": "^6.22.0",
"eslint": "^7.32.0",
"eslint-plugin-react": "^7.20.0",
"eslint-plugin-react-native": "^3.8.1",
"husky": "^7.0.1",
"metro-react-native-babel-preset": "^0.63.0",
"react": "16.11.0",
"react-dom": "^17.0.1",
"react-native": "0.62.2",
"react-native-builder-bob": "^0.18.2",
"eslint": "^8.18.0",
"eslint-plugin-import": "^2.26.0",
"husky": "^8.0.1",
"jest": "^28.1.0",
"metro-react-native-babel-preset": "^0.71.1",
"prettier": "^2.7.1",
"react": "17.0.2",
"react-dom": "^17.0.2",
"react-native": "0.68.2",
"react-native-builder-bob": "^0.18.3",
"react-native-gesture-handler": "^1.10.3",
"react-native-reanimated": "^2.2.3",
"typescript": "^4.4.2"
"react-native-reanimated": "^2.3.2",
"react-test-renderer": "16.13.1",
"typescript": "^4.7.4"
},
"resolutions": {
"@types/react": "^17"
},
"husky": {
"hooks": {
"pre-commit": "yarn lint"
}
},
"keywords": [
"react-native",
"react",
Expand Down Expand Up @@ -93,5 +97,31 @@
}
]
]
},
"jest": {
"preset": "react-native",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
],
"testEnvironment": "node",
"clearMocks": true,
"setupFilesAfterEnv": [
"<rootDir>/jest.setup.js"
],
"setupFiles": [
"<rootDir>/jest.setup.js"
],
"modulePathIgnorePatterns": [
"<rootDir>/lib/"
],
"transformIgnorePatterns": []
},
"dependencies": {
"react-native-redash": "*"
}
}
Loading

0 comments on commit 471f5a2

Please sign in to comment.