Skip to content

Commit 5cd68e9

Browse files
committed
upgrade-rn-77
1 parent bffb31f commit 5cd68e9

File tree

313 files changed

+23412
-3596
lines changed

Some content is hidden

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

313 files changed

+23412
-3596
lines changed

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.6.10'
5+
6+
gem 'cocoapods', '>= 1.11.3'

babel.config.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
module.exports = function (api) {
2-
api && api.cache(false);
3-
return {
4-
presets: [
5-
'module:metro-react-native-babel-preset'
6-
],
7-
plugins: [
8-
'@babel/plugin-proposal-export-namespace-from',
9-
'@babel/plugin-proposal-export-default-from'
10-
]
11-
};
12-
};
1+
module.exports = {
2+
presets: ['module:@react-native/babel-preset'],
3+
};

example/.gitignore

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

example/.watchmanconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{}

example/App.tsx

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
/**
2+
* Sample React Native App
3+
* https://github.com/facebook/react-native
4+
*
5+
* @format
6+
*/
7+
8+
import React from 'react';
9+
import type {PropsWithChildren} from 'react';
10+
import {
11+
SafeAreaView,
12+
ScrollView,
13+
StatusBar,
14+
StyleSheet,
15+
Text,
16+
useColorScheme,
17+
View,
18+
} from 'react-native';
19+
20+
import {
21+
Colors,
22+
DebugInstructions,
23+
Header,
24+
LearnMoreLinks,
25+
ReloadInstructions,
26+
} from 'react-native/Libraries/NewAppScreen';
27+
28+
type SectionProps = PropsWithChildren<{
29+
title: string;
30+
}>;
31+
32+
function Section({children, title}: SectionProps): React.JSX.Element {
33+
const isDarkMode = useColorScheme() === 'dark';
34+
return (
35+
<View style={styles.sectionContainer}>
36+
<Text
37+
style={[
38+
styles.sectionTitle,
39+
{
40+
color: isDarkMode ? Colors.white : Colors.black,
41+
},
42+
]}>
43+
{title}
44+
</Text>
45+
<Text
46+
style={[
47+
styles.sectionDescription,
48+
{
49+
color: isDarkMode ? Colors.light : Colors.dark,
50+
},
51+
]}>
52+
{children}
53+
</Text>
54+
</View>
55+
);
56+
}
57+
58+
function App(): React.JSX.Element {
59+
const isDarkMode = useColorScheme() === 'dark';
60+
61+
const backgroundStyle = {
62+
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
63+
};
64+
65+
return (
66+
<SafeAreaView style={backgroundStyle}>
67+
<StatusBar
68+
barStyle={isDarkMode ? 'light-content' : 'dark-content'}
69+
backgroundColor={backgroundStyle.backgroundColor}
70+
/>
71+
<ScrollView
72+
contentInsetAdjustmentBehavior="automatic"
73+
style={backgroundStyle}>
74+
<Header />
75+
<View
76+
style={{
77+
backgroundColor: isDarkMode ? Colors.black : Colors.white,
78+
}}>
79+
<Section title="Step One">
80+
Edit <Text style={styles.highlight}>App.tsx</Text> to change this
81+
screen and then come back to see your edits.
82+
</Section>
83+
<Section title="See Your Changes">
84+
<ReloadInstructions />
85+
</Section>
86+
<Section title="Debug">
87+
<DebugInstructions />
88+
</Section>
89+
<Section title="Learn More">
90+
Read the docs to discover what to do next:
91+
</Section>
92+
<LearnMoreLinks />
93+
</View>
94+
</ScrollView>
95+
</SafeAreaView>
96+
);
97+
}
98+
99+
const styles = StyleSheet.create({
100+
sectionContainer: {
101+
marginTop: 32,
102+
paddingHorizontal: 24,
103+
},
104+
sectionTitle: {
105+
fontSize: 24,
106+
fontWeight: '600',
107+
},
108+
sectionDescription: {
109+
marginTop: 8,
110+
fontSize: 18,
111+
fontWeight: '400',
112+
},
113+
highlight: {
114+
fontWeight: '700',
115+
},
116+
});
117+
118+
export default App;

example/NotificationsExampleApp.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {useState, useEffect} from 'react';
1+
import {useState, useEffect} from 'react';
22
import {
33
StyleSheet,
44
View,
@@ -26,29 +26,35 @@ export default function NotificationsExampleApp() {
2626

2727
const registerNotificationEvents = () => {
2828
Notifications.events().registerNotificationReceivedForeground((notification, completion) => {
29+
console.log('registerNotificationReceivedForeground', notification);
2930
setNotifications([...notifications, notification]);
3031
completion({alert: notification.payload.showAlert, sound: false, badge: false});
3132
});
32-
33+
3334
Notifications.events().registerNotificationOpened((notification, completion) => {
3435
setOpenedNotifications([notification, ...openedNotifications]);
3536
completion();
3637
});
3738

3839
Notifications.events().registerNotificationReceivedBackground((notification, completion) => {
40+
console.log('registerNotificationReceivedBackground', notification);
3941
completion(NotificationBackgroundFetchResult.NO_DATA);
4042
});
4143

44+
Notifications.events().registerRemoteNotificationsRegistered((event) => {
45+
console.log('registerRemoteNotificationsRegistered', event);
46+
});
47+
4248
if (Platform.OS === 'ios') {
4349
Notifications.ios.events().appNotificationSettingsLinked(() => {
4450
console.warn('App Notification Settings Linked')
4551
});
4652
}
4753
}
4854

49-
const requestPermissionsIos = (options) => {
55+
const requestPermissionsIos = (options: string[]) => {
5056
Notifications.ios.registerRemoteNotifications(
51-
Object.fromEntries(options.map(opt => [opt, true]))
57+
Object.fromEntries(options.map((opt: string) => [opt, true]))
5258
);
5359
}
5460

@@ -81,7 +87,7 @@ export default function NotificationsExampleApp() {
8187
[upvoteAction, replyAction]
8288
);
8389

84-
Notifications.setCategories([category]);
90+
Notifications.setCategories;
8591
}
8692

8793
const sendLocalNotification = () => {

example/android/.gitignore

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

example/android/app/.cxx/Debug/611z652v/arm64-v8a/.cmake/api/v1/query/client-agp/cache-v2

Whitespace-only changes.

example/android/app/.cxx/Debug/611z652v/arm64-v8a/.cmake/api/v1/query/client-agp/cmakeFiles-v1

Whitespace-only changes.

example/android/app/.cxx/Debug/611z652v/arm64-v8a/.cmake/api/v1/query/client-agp/codemodel-v2

Whitespace-only changes.

0 commit comments

Comments
 (0)