Skip to content

Commit e32fb79

Browse files
committed
chore(example app): upgrade example app to RNv0.69.1
1 parent 54afdc8 commit e32fb79

File tree

65 files changed

+5844
-5436
lines changed

Some content is hidden

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

65 files changed

+5844
-5436
lines changed

example/.flowconfig

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88
; Ignore polyfills
99
node_modules/react-native/Libraries/polyfills/.*
1010

11-
; These should not be required directly
12-
; require from fbjs/lib instead: require('fbjs/lib/warning')
13-
node_modules/warning/.*
14-
1511
; Flow doesn't support platforms
1612
.*/Libraries/Utilities/LoadingView.js
1713

14+
.*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$
15+
1816
[untyped]
1917
.*/node_modules/@react-native-community/cli/.*/.*
2018

@@ -27,8 +25,9 @@ node_modules/react-native/flow/
2725
[options]
2826
emoji=true
2927

30-
esproposal.optional_chaining=enable
31-
esproposal.nullish_coalescing=enable
28+
exact_by_default=true
29+
30+
format.bracket_spacing=false
3231

3332
module.file_ext=.js
3433
module.file_ext=.json
@@ -44,10 +43,6 @@ suppress_type=$FlowFixMe
4443
suppress_type=$FlowFixMeProps
4544
suppress_type=$FlowFixMeState
4645

47-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
48-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
49-
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
50-
5146
[lints]
5247
sketchy-null-number=warn
5348
sketchy-null-mixed=warn
@@ -57,8 +52,6 @@ nonstrict-import=warn
5752
deprecated-type=warn
5853
unsafe-getters-setters=warn
5954
unnecessary-invariant=warn
60-
signature-verification-failure=warn
61-
deprecated-utility=error
6255

6356
[strict]
6457
deprecated-type
@@ -70,4 +63,4 @@ untyped-import
7063
untyped-type-import
7164

7265
[version]
73-
^0.122.0
66+
^0.176.3

example/.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

example/.gitignore

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23+
ios/.xcode.env.local
2324

2425
# Android/IntelliJ
2526
#
@@ -28,6 +29,7 @@ build/
2829
.gradle
2930
local.properties
3031
*.iml
32+
*.hprof
3133

3234
# node.js
3335
#
@@ -48,12 +50,14 @@ buck-out/
4850
# For more information about the recommended setup visit:
4951
# https://docs.fastlane.tools/best-practices/source-control/
5052

51-
*/fastlane/report.xml
52-
*/fastlane/Preview.html
53-
*/fastlane/screenshots
53+
**/fastlane/report.xml
54+
**/fastlane/Preview.html
55+
**/fastlane/screenshots
56+
**/fastlane/test_output
5457

5558
# Bundle artifact
5659
*.jsbundle
5760

58-
# CocoaPods
61+
# Ruby / CocoaPods
5962
/ios/Pods/
63+
/vendor/bundle/

example/.prettierrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
24
bracketSpacing: false,
3-
jsxBracketSameLine: true,
45
singleQuote: true,
56
trailingComma: 'all',
67
};

example/App.js

Lines changed: 54 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
import React, {useState, useCallback} from 'react';
2-
import {Text, SafeAreaView, TouchableOpacity, StatusBar} from 'react-native';
1+
import React, {useState, useCallback, useEffect} from 'react';
2+
import {
3+
Text,
4+
SafeAreaView,
5+
TouchableOpacity,
6+
StatusBar,
7+
StyleSheet,
8+
} from 'react-native';
39
import RNBiometrics from 'react-native-simple-biometrics';
410

511
const App = () => {
612
const [canAuth, setCanAuth] = useState(null);
713
const [authenticated, setAuthenticated] = useState(null);
814

9-
const checkCanAuth = useCallback(async () => {
10-
const success = await RNBiometrics.canAuthenticate();
11-
setCanAuth(success);
15+
useEffect(() => {
16+
RNBiometrics.canAuthenticate().then(setCanAuth);
1217
}, []);
1318

1419
const authenticate = useCallback(async () => {
@@ -25,35 +30,54 @@ const App = () => {
2530
}, []);
2631

2732
return (
28-
<SafeAreaView
29-
style={{
30-
flex: 1,
31-
padding: 16,
32-
alignItems: 'center',
33-
justifyContent: 'center',
34-
backgroundColor: '#5e548e',
35-
}}>
33+
<SafeAreaView style={styles.container}>
3634
<StatusBar backgroundColor="#fa7e61" />
37-
<TouchableOpacity
38-
onPress={authenticate}
39-
style={{
40-
padding: 16,
41-
borderRadius: 8,
42-
alignItems: 'center',
43-
backgroundColor: '#fa7e61',
44-
}}>
45-
<Text style={{color: 'white', fontSize: 18, fontWeight: 'bold'}}>
46-
Bank Balance
47-
</Text>
48-
<Text style={{color: '#6F1D1B', padding: 12}}>
49-
{authenticated ? '🔓' : '🔒'}
50-
</Text>
51-
<Text style={{color: '#6F1D1B'}}>
52-
{authenticated ? '$1,000,000' : '(tap to unlock)'}
53-
</Text>
35+
<TouchableOpacity onPress={authenticate} style={styles.button}>
36+
<Text style={styles.title}>Bank Balance</Text>
37+
{canAuth ? (
38+
<>
39+
<Text style={[styles.subtitle, styles.amount]}>
40+
{authenticated ? '🔓' : '🔒'}
41+
</Text>
42+
<Text style={styles.subtitle}>
43+
{authenticated ? '$1,000,000' : '(tap to unlock)'}
44+
</Text>
45+
</>
46+
) : (
47+
<Text style={[styles.subtitle, styles.amount]}>
48+
Error, can't use biometrics to authenticate
49+
</Text>
50+
)}
5451
</TouchableOpacity>
5552
</SafeAreaView>
5653
);
5754
};
5855

56+
const styles = StyleSheet.create({
57+
container: {
58+
flex: 1,
59+
padding: 16,
60+
alignItems: 'center',
61+
justifyContent: 'center',
62+
backgroundColor: '#5e548e',
63+
},
64+
button: {
65+
padding: 16,
66+
borderRadius: 8,
67+
alignItems: 'center',
68+
backgroundColor: '#fa7e61',
69+
},
70+
title: {
71+
fontSize: 18,
72+
color: 'white',
73+
fontWeight: 'bold',
74+
},
75+
subtitle: {
76+
color: '#6F1D1B',
77+
},
78+
amount: {
79+
padding: 12,
80+
},
81+
});
82+
5983
export default App;

example/Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby '2.7.5'
5+
6+
gem 'cocoapods', '~> 1.11', '>= 1.11.2'

example/__tests__/App-test.js

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

example/_bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

example/_ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.7.5

example/android/app/_BUCK

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ android_library(
3535

3636
android_build_config(
3737
name = "build_config",
38-
package = "com.example",
38+
package = "com.rnsimplebiometrics",
3939
)
4040

4141
android_resource(
4242
name = "res",
43-
package = "com.example",
43+
package = "com.rnsimplebiometrics",
4444
res = "src/main/res",
4545
)
4646

0 commit comments

Comments
 (0)