-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGo.js
More file actions
50 lines (45 loc) · 1.05 KB
/
Copy pathGo.js
File metadata and controls
50 lines (45 loc) · 1.05 KB
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
import React from 'react';
import { TouchableOpacity, Text, StyleSheet, View } from 'react-native';
const MyButton = ({ onPress, title }) => {
return (
<TouchableOpacity
style={styles.button}
onPress={onPress} // Function to be called when button is pressed
>
<Text style={styles.buttonText}>{title}</Text>
</TouchableOpacity>
);
};
const App = () => {
const handlePress = () => {
console.log('Button pressed!');
};
return (
<View style={styles.container}>
<MyButton onPress={handlePress} title="GO" />
</View>
);
};
const styles = StyleSheet.create({
container: {
left:"70%",
width:"25%",
bottom:"27%",
},
button: {
backgroundColor: '#4CAF50', // Green background
paddingVertical: 10,
paddingHorizontal: 20,
borderRadius: 15,
shadowColor: '#000', // Add shadow for iOS
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.2,
shadowRadius: 5,
},
buttonText: {
color: 'white',
fontSize: 26,
fontWeight: 'bold',
},
});
export default App;