-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoute.js
More file actions
30 lines (27 loc) · 779 Bytes
/
Copy pathRoute.js
File metadata and controls
30 lines (27 loc) · 779 Bytes
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
import React from 'react';
import { Text, StyleSheet, View, TouchableOpacity } from 'react-native';
const Route = ({ name, color, onPress }) => {
return (
<TouchableOpacity style={[styles.container, { backgroundColor: color }]} onPress={onPress}>
<Text style={styles.text}>{name}</Text>
</TouchableOpacity>
);
};
const styles = StyleSheet.create({
container: {
display: 'flex',
position: 'relative', // Remove 'flexbox' and 'position' properties, these were incorrect
width: '33%',
height: '30%',
justifyContent: 'center',
alignItems: 'center',
borderRadius: 25,
margin: 5, // Optional: Adds spacing between buttons
},
text: {
fontSize: 12,
color: 'white',
fontWeight: 'bold',
},
});
export default Route;