-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
101 lines (88 loc) · 2.11 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/
import React from 'react';
import {
Linking,
Pressable,
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
useColorScheme,
View,
NativeModules,
Button,
Image,
} from 'react-native';
const gif = require('./giphy.gif');
const styles = new StyleSheet.create({
container: {
backgroundColor: 'black',
justifyContent: 'center',
alignItems: 'center',
flex: 1,
},
button: {
height: 56,
width: 120,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'blue',
},
buttonText: {
color: 'white',
},
text: {
color: 'white',
fontSize: 20,
marginBottom: 20,
},
link: {
textDecorationStyle: 'solid',
textDecorationColor: 'white',
textDecorationLine: 'underline',
},
});
function App(props) {
console.log('app props', props);
const handleDone = () => {
// Call the function that has been exposed on the native module to close the screen.
NativeModules.ActionExtension.done();
};
const handleIncrease = () => {
// Call the function that has been exposed on the native module to close the screen.
NativeModules.ActionExtension.increaseFontSize();
};
const handleDecrease = () => {
// Call the function that has been exposed on the native module to close the screen.
NativeModules.ActionExtension.decreaseFontSize();
};
if (props.browserExtension) {
return (
<SafeAreaView style={styles.container}>
<Text style={styles.text}>
The browser extension using React Native
</Text>
<Text style={styles.text}>Here it's work in progress. Welcome</Text>
</SafeAreaView>
);
}
return (
<SafeAreaView style={styles.container}>
<Text style={styles.text}>Browser Extension App</Text>
<Pressable
onPress={() => {
Linking.openURL('https://givefreely.com/');
}}>
<Text style={[styles.text, styles.link]}>Click here to try</Text>
</Pressable>
<Image source={gif} />
</SafeAreaView>
);
}
export default App;