Skip to content

Commit e784a81

Browse files
committed
Upgrade react-native to 0.72, upgrade dependencies
1 parent f73afb7 commit e784a81

Some content is hidden

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

52 files changed

+7440
-8273
lines changed

.eslintrc.js

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
module.exports = {
22
root: true,
3-
extends: '@react-native-community',
4-
parser: '@typescript-eslint/parser',
5-
plugins: ['@typescript-eslint'],
6-
overrides: [
7-
{
8-
files: ['*.ts', '*.tsx'],
9-
rules: {
10-
'@typescript-eslint/no-shadow': ['error'],
11-
'no-shadow': 'off',
12-
'no-undef': 'off',
13-
},
14-
},
15-
],
3+
extends: '@react-native',
4+
ignorePatterns: ['/coverage/*'],
165
};

.npmignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
coverage/
22
example/
3-
demo/
3+
demo/

example/.buckconfig

-6
This file was deleted.

example/.gitignore

+14-9
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
#
@@ -29,33 +30,37 @@ build/
2930
local.properties
3031
*.iml
3132
*.hprof
33+
.cxx/
34+
*.keystore
35+
!debug.keystore
3236

3337
# node.js
3438
#
3539
node_modules/
3640
npm-debug.log
3741
yarn-error.log
3842

39-
# BUCK
40-
buck-out/
41-
\.buckd/
42-
*.keystore
43-
!debug.keystore
44-
4543
# fastlane
4644
#
4745
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
4846
# screenshots whenever they are needed.
4947
# For more information about the recommended setup visit:
5048
# https://docs.fastlane.tools/best-practices/source-control/
5149

52-
*/fastlane/report.xml
53-
*/fastlane/Preview.html
54-
*/fastlane/screenshots
50+
**/fastlane/report.xml
51+
**/fastlane/Preview.html
52+
**/fastlane/screenshots
53+
**/fastlane/test_output
5554

5655
# Bundle artifact
5756
*.jsbundle
5857

5958
# Ruby / CocoaPods
6059
/ios/Pods/
6160
/vendor/bundle/
61+
62+
# Temporary files created by Metro to check the health of the file watcher
63+
.metro-health-check*
64+
65+
# testing
66+
/coverage

example/.ruby-version

-1
This file was deleted.

example/.watchmanconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{}

example/App.tsx

+78-40
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,72 @@
1-
import React from 'react';
2-
import { Appearance, SafeAreaView, StatusBar, StyleSheet, Text, View } from 'react-native';
3-
import { Userpic } from 'react-native-userpic';
1+
import React, { useCallback, useState } from 'react';
2+
import { Appearance, ImageSourcePropType, StatusBar, StyleSheet, Text, View } from 'react-native';
3+
import { Userpic, UserpicProps } from 'react-native-userpic';
44

55
StatusBar.setBarStyle('light-content');
66

77
function colorScheme(lightColor: string, darkColor: string) {
88
return Appearance.getColorScheme() === 'dark' ? darkColor : lightColor;
99
}
1010

11-
// Random user images:
12-
const images = [
13-
'https://minimaltoolkit.com/images/randomdata/male/78.jpg',
14-
'https://minimaltoolkit.com/images/randomdata/male/62.jpg',
15-
'https://minimaltoolkit.com/images/randomdata/male/46.jpg',
16-
'https://minimaltoolkit.com/images/randomdata/female/107.jpg',
17-
'https://minimaltoolkit.com/images/randomdata/female/70.jpg',
18-
'https://minimaltoolkit.com/images/randomdata/female/96.jpg',
11+
const IMAGES = [
12+
{ uri: 'https://example.com/image.png' },
13+
{ uri: 'https://xsgames.co/randomusers/assets/avatars/female/44.jpg' },
14+
{ uri: 'https://xsgames.co/randomusers/assets/avatars/male/42.jpg' },
15+
{ uri: 'https://xsgames.co/randomusers/assets/avatars/female/38.jpg' },
16+
{ uri: 'https://xsgames.co/randomusers/assets/avatars/male/73.jpg' },
17+
{ uri: 'https://xsgames.co/randomusers/assets/avatars/female/2.jpg' },
18+
{ uri: 'https://xsgames.co/randomusers/assets/avatars/male/46.jpg' },
1919
];
2020

21-
const App = () => (
22-
<SafeAreaView style={styles.container}>
23-
<View style={styles.content}>
21+
const App = () => {
22+
const [badge, setBadge] = useState<number>(0);
23+
const [image, setImage] = useState<number>(1);
24+
const [badImage, setBadImage] = useState<ImageSourcePropType>();
25+
26+
const toggleBadge = useCallback(() => {
27+
console.log('-- STATE UPDATED --');
28+
setBadge(badge === 5 ? 0 : badge + 1);
29+
}, [badge]);
30+
31+
const toggleImage = useCallback(() => {
32+
console.log('-- STATE UPDATED --');
33+
setImage(image + 1 === IMAGES.length ? 0 : image + 1);
34+
}, [image]);
35+
36+
const toggleBadImage = useCallback(() => {
37+
console.log('-- STATE UPDATED --');
38+
setBadImage(badImage ? undefined : IMAGES[0]);
39+
}, [badImage]);
40+
41+
return (
42+
<View style={styles.container}>
2443
<View style={styles.row}>
2544
<Text style={styles.label}>Shape</Text>
2645
<Userpic borderRadius={0} />
27-
<Userpic borderRadius="25%" />
28-
<Userpic borderRadius="50%" />
46+
<Userpic borderRadius={15} />
47+
<Userpic />
2948
</View>
3049
<View style={styles.row}>
31-
<Text style={styles.label}>No image</Text>
32-
<Userpic />
50+
<Text style={styles.label} onPress={toggleBadImage}>
51+
No image
52+
</Text>
53+
<Userpic source={badImage} />
3354
<Userpic defaultSource={require('./assets/custom.png')} />
3455
<Userpic name="👩" />
3556
</View>
3657
<View style={styles.row}>
3758
<Text style={styles.label}>Initials</Text>
38-
<Userpic name="Nick" />
59+
<Userpic name="Nick" color="gray" />
3960
<Userpic name="Jason Smith" colorize={true} />
40-
<Userpic name="Emma Miller" colorize={true} />
61+
<Userpic name="Emma Miller" email="[email protected]" colorize={true} />
4162
</View>
4263
<View style={styles.row}>
43-
<Text style={styles.label}>Image</Text>
44-
<Userpic source={{ uri: images[1] }} />
45-
<Userpic source={{ uri: images[2] }} />
46-
<Userpic source={{ uri: images[5] }} />
64+
<Text style={styles.label} onPress={toggleImage}>
65+
Image
66+
</Text>
67+
<Userpic source={IMAGES[image]} />
68+
<Userpic source={IMAGES[3]} />
69+
<Userpic source={IMAGES[6]} />
4770
</View>
4871
<View style={styles.row}>
4972
<Text style={styles.label}>Gravatar</Text>
@@ -52,36 +75,50 @@ const App = () => (
5275
<Userpic borderRadius={10} email="[email protected]" />
5376
</View>
5477
<View style={styles.row}>
55-
<Text style={styles.label}>Badge</Text>
56-
<Userpic badge={true} badgeColor="#34c759" email="[email protected]" />
57-
<Userpic badge={3} badgeColor="#007aff" email="[email protected]" />
58-
<Userpic badge={100} email="[email protected]" />
78+
<Text style={styles.label} onPress={toggleBadge}>
79+
Badge
80+
</Text>
81+
<Userpic
82+
source={IMAGES[1]}
83+
84+
badge={!!badge}
85+
badgeColor="#34c759"
86+
/>
87+
<Userpic
88+
borderRadius={20}
89+
90+
badge={badge}
91+
badgeColor="#007aff"
92+
/>
93+
<Userpic
94+
borderRadius={10}
95+
96+
badge={badge ? badge + 100 : undefined}
97+
/>
5998
</View>
6099
<View style={styles.row}>
61100
<Text style={styles.label}>Status</Text>
62-
<Userpic badge="👋" badgeProps={statusBadgeProps} email="[email protected]" />
63-
<Userpic badge="😀" badgeProps={statusBadgeProps} email="[email protected]" />
64-
<Userpic badge="🐵" badgeProps={statusBadgeProps} email="[email protected]" />
101+
<Userpic email="[email protected]" badge="👋" badgeProps={statusBadgeProps} />
102+
<Userpic email="[email protected]" badge="😀" badgeProps={statusBadgeProps} />
103+
<Userpic email="[email protected]" badge="🐵" badgeProps={statusBadgeProps} />
65104
</View>
66105
<View style={styles.row}>
67106
<Text style={styles.label}>Size</Text>
68-
<Userpic borderRadius="25%" size={30} email="[email protected]" />
69-
<Userpic borderRadius="25%" size={50} email="[email protected]" />
70-
<Userpic borderRadius="25%" size={75} email="[email protected]" />
107+
<Userpic borderRadius={8} size={30} email="[email protected]" />
108+
<Userpic borderRadius={12} size={50} email="[email protected]" />
109+
<Userpic borderRadius={18} size={75} email="[email protected]" />
71110
</View>
72111
</View>
73-
</SafeAreaView>
74-
);
112+
);
113+
};
75114

76115
const styles = StyleSheet.create({
77116
container: {
78117
flex: 1,
118+
padding: 30,
79119
justifyContent: 'center',
80120
backgroundColor: colorScheme('#fff', '#212124'),
81121
},
82-
content: {
83-
margin: 30,
84-
},
85122
row: {
86123
marginVertical: 10,
87124
flexDirection: 'row',
@@ -104,8 +141,9 @@ const styles = StyleSheet.create({
104141
},
105142
});
106143

107-
const statusBadgeProps = {
144+
const statusBadgeProps: UserpicProps['badgeProps'] = {
108145
size: 22,
146+
position: 'bottom-right',
109147
style: styles.badgeStyle,
110148
textStyle: styles.badgeTextStyle,
111149
};

example/Gemfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source 'https://rubygems.org'
22

33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4-
ruby '2.7.4'
4+
ruby ">= 2.6.10"
55

6-
gem 'cocoapods', '~> 1.11', '>= 1.11.2'
6+
gem 'cocoapods', '~> 1.12'

example/Gemfile.lock

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.6)
5+
rexml
6+
activesupport (6.1.7.3)
7+
concurrent-ruby (~> 1.0, >= 1.0.2)
8+
i18n (>= 1.6, < 2)
9+
minitest (>= 5.1)
10+
tzinfo (~> 2.0)
11+
zeitwerk (~> 2.3)
12+
addressable (2.8.4)
13+
public_suffix (>= 2.0.2, < 6.0)
14+
algoliasearch (1.27.5)
15+
httpclient (~> 2.8, >= 2.8.3)
16+
json (>= 1.5.1)
17+
atomos (0.1.3)
18+
claide (1.1.0)
19+
cocoapods (1.12.1)
20+
addressable (~> 2.8)
21+
claide (>= 1.0.2, < 2.0)
22+
cocoapods-core (= 1.12.1)
23+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
24+
cocoapods-downloader (>= 1.6.0, < 2.0)
25+
cocoapods-plugins (>= 1.0.0, < 2.0)
26+
cocoapods-search (>= 1.0.0, < 2.0)
27+
cocoapods-trunk (>= 1.6.0, < 2.0)
28+
cocoapods-try (>= 1.1.0, < 2.0)
29+
colored2 (~> 3.1)
30+
escape (~> 0.0.4)
31+
fourflusher (>= 2.3.0, < 3.0)
32+
gh_inspector (~> 1.0)
33+
molinillo (~> 0.8.0)
34+
nap (~> 1.0)
35+
ruby-macho (>= 2.3.0, < 3.0)
36+
xcodeproj (>= 1.21.0, < 2.0)
37+
cocoapods-core (1.12.1)
38+
activesupport (>= 5.0, < 8)
39+
addressable (~> 2.8)
40+
algoliasearch (~> 1.0)
41+
concurrent-ruby (~> 1.1)
42+
fuzzy_match (~> 2.0.4)
43+
nap (~> 1.0)
44+
netrc (~> 0.11)
45+
public_suffix (~> 4.0)
46+
typhoeus (~> 1.0)
47+
cocoapods-deintegrate (1.0.5)
48+
cocoapods-downloader (1.6.3)
49+
cocoapods-plugins (1.0.0)
50+
nap
51+
cocoapods-search (1.0.1)
52+
cocoapods-trunk (1.6.0)
53+
nap (>= 0.8, < 2.0)
54+
netrc (~> 0.11)
55+
cocoapods-try (1.2.0)
56+
colored2 (3.1.2)
57+
concurrent-ruby (1.2.2)
58+
escape (0.0.4)
59+
ethon (0.16.0)
60+
ffi (>= 1.15.0)
61+
ffi (1.15.5)
62+
fourflusher (2.3.1)
63+
fuzzy_match (2.0.4)
64+
gh_inspector (1.1.3)
65+
httpclient (2.8.3)
66+
i18n (1.14.1)
67+
concurrent-ruby (~> 1.0)
68+
json (2.6.3)
69+
minitest (5.18.1)
70+
molinillo (0.8.0)
71+
nanaimo (0.3.0)
72+
nap (1.1.0)
73+
netrc (0.11.0)
74+
public_suffix (4.0.7)
75+
rexml (3.2.5)
76+
ruby-macho (2.5.1)
77+
typhoeus (1.4.0)
78+
ethon (>= 0.9.0)
79+
tzinfo (2.0.6)
80+
concurrent-ruby (~> 1.0)
81+
xcodeproj (1.22.0)
82+
CFPropertyList (>= 2.3.3, < 4.0)
83+
atomos (~> 0.1.3)
84+
claide (>= 1.0.2, < 2.0)
85+
colored2 (~> 3.1)
86+
nanaimo (~> 0.3.0)
87+
rexml (~> 3.2.4)
88+
zeitwerk (2.6.8)
89+
90+
PLATFORMS
91+
ruby
92+
93+
DEPENDENCIES
94+
cocoapods (~> 1.12)
95+
96+
RUBY VERSION
97+
ruby 2.6.10p210
98+
99+
BUNDLED WITH
100+
1.17.2

0 commit comments

Comments
 (0)