Skip to content

Commit 2d5dcc4

Browse files
committed
new: Library is fundamentally here
1 parent 4a6eb19 commit 2d5dcc4

44 files changed

Lines changed: 11070 additions & 3544 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

example/.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Windows files
2+
[*.bat]
3+
end_of_line = crlf

example/.eslintrc.js

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,77 @@
11
module.exports = {
22
root: true,
3-
extends: '@react-native-community',
3+
extends: "@react-native-community",
4+
parser: "@typescript-eslint/parser",
5+
plugins: ["import", "eslint-plugin-import", "@typescript-eslint"],
6+
settings: {
7+
"import/resolver": {
8+
node: {
9+
extensions: [
10+
".js",
11+
".jsx",
12+
".ts",
13+
".tsx",
14+
".d.ts",
15+
".android.js",
16+
".android.jsx",
17+
".android.ts",
18+
".android.tsx",
19+
".ios.js",
20+
".ios.jsx",
21+
".ios.ts",
22+
".ios.tsx",
23+
".web.js",
24+
".web.jsx",
25+
".web.ts",
26+
".web.tsx",
27+
],
28+
},
29+
},
30+
},
31+
rules: {
32+
quotes: [
33+
"error",
34+
"double",
35+
{
36+
avoidEscape: true,
37+
},
38+
],
39+
"max-len": ["error", 120],
40+
"@typescript-eslint/ban-ts-comment": 2,
41+
"@typescript-eslint/no-explicit-any": 2,
42+
"@typescript-eslint/explicit-module-boundary-types": 0,
43+
"react/jsx-filename-extension": ["error", { extensions: [".tsx"] }],
44+
"react-native/no-unused-styles": 2,
45+
"react-native/split-platform-components": 2,
46+
"react-native/no-inline-styles": 0,
47+
"react-native/no-color-literals": 0,
48+
"react-native/no-raw-text": 0,
49+
"import/no-extraneous-dependencies": 2,
50+
"import/extensions": ["error", "never", { svg: "always" }],
51+
"import/no-named-as-default-member": 2,
52+
"import/order": ["error", { "newlines-between": "always" }],
53+
"import/no-duplicates": 2,
54+
"import/no-useless-path-segments": 2,
55+
"import/no-cycle": 2,
56+
"import/prefer-default-export": 0,
57+
"import/no-anonymous-default-export": 0,
58+
"import/named": 0,
59+
"@typescript-eslint/no-empty-interface": 0,
60+
"import/namespace": 0,
61+
"import/default": 0,
62+
"import/no-named-as-default": 0,
63+
"import/no-unused-modules": 0,
64+
"import/no-deprecated": 0,
65+
"@typescript-eslint/indent": 0,
66+
"react-hooks/rules-of-hooks": 2,
67+
"react-hooks/exhaustive-deps": [
68+
"error",
69+
{ additionalHooks: "(useMemoOne)" },
70+
],
71+
"jest/no-identical-title": 2,
72+
"jest/valid-expect": 2,
73+
camelcase: 2,
74+
"prefer-destructuring": 2,
75+
"no-nested-ternary": 2,
76+
},
477
};

example/.flowconfig

Lines changed: 0 additions & 73 deletions
This file was deleted.

example/.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
*.pbxproj -text
1+
# Windows files should use crlf line endings
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
*.bat text eol=crlf

example/.prettierrc.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module.exports = {
2-
bracketSpacing: false,
3-
jsxBracketSameLine: true,
4-
singleQuote: true,
5-
trailingComma: 'all',
2+
bracketSpacing: true,
3+
jsxBracketSameLine: false,
4+
singleQuote: false,
5+
trailingComma: "all",
6+
tabWidth: 2,
7+
semi: true,
68
};

example/App.js

Lines changed: 0 additions & 114 deletions
This file was deleted.

example/App.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
import React from 'react';
3+
import {
4+
SafeAreaView,
5+
ScrollView,
6+
StatusBar,
7+
StyleSheet,
8+
Text,
9+
useColorScheme,
10+
View,
11+
} from 'react-native';
12+
import SwitchButton from './lib/SwitchButton';
13+
14+
const App = () => {
15+
16+
17+
return (
18+
<SafeAreaView style={{flex:1, margin:32 }}>
19+
<SwitchButton inactiveImageSource={require("./assets/notification.png")} activeImageSource={require("./assets/notification-3.png")} />
20+
</SafeAreaView>
21+
);
22+
};
23+
24+
25+
export default App;

example/android/app/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ def jscFlavor = 'org.webkit:android-jsc:+'
121121
def enableHermes = project.ext.react.get("enableHermes", false);
122122

123123
android {
124+
ndkVersion rootProject.ext.ndkVersion
125+
124126
compileSdkVersion rootProject.ext.compileSdkVersion
125127

126128
compileOptions {
@@ -169,11 +171,12 @@ android {
169171
variant.outputs.each { output ->
170172
// For each separate APK per architecture, set a unique version code as described here:
171173
// https://developer.android.com/studio/build/configure-apk-splits.html
174+
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
172175
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
173176
def abi = output.getFilter(OutputFile.ABI)
174177
if (abi != null) { // null for the universal-debug, universal-release variants
175178
output.versionCodeOverride =
176-
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
179+
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
177180
}
178181

179182
}

example/android/app/src/debug/AndroidManifest.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@
44

55
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
66

7-
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
7+
<application
8+
android:usesCleartextTraffic="true"
9+
tools:targetApi="28"
10+
tools:ignore="GoogleAppIndexingWarning">
11+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
12+
</application>
813
</manifest>

0 commit comments

Comments
 (0)