-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathindex.tsx
More file actions
107 lines (101 loc) · 2.71 KB
/
index.tsx
File metadata and controls
107 lines (101 loc) · 2.71 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
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
102
103
104
105
106
107
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { RectButton } from 'react-native-gesture-handler';
export default function RectButtonBorders() {
return (
<View style={styles.container}>
<Button text="Border Radius" style={{ borderRadius: 16 }} />
<Button
text="Border Top Left Radius"
style={{ borderTopLeftRadius: 16 }}
/>
<Button
text="Border Top Right Radius"
style={{ borderTopRightRadius: 16 }}
/>
<Button
text="Border Bottom Left Radius"
style={{ borderBottomLeftRadius: 16 }}
/>
<Button
text="Border Bottom Right Radius"
style={{ borderBottomRightRadius: 16 }}
/>
<Button
text="Border Top Radius"
style={{ borderTopLeftRadius: 16, borderTopRightRadius: 16 }}
/>
<Button
text="Border Bottom Radius"
style={{ borderBottomLeftRadius: 16, borderBottomRightRadius: 16 }}
/>
<Button
text="Border Radius and Top Radius"
style={{
borderRadius: 8,
borderTopLeftRadius: 32,
borderTopRightRadius: 32,
}}
/>
<Button
text="Border Radius and Bottom Radius"
style={{
borderRadius: 8,
borderBottomLeftRadius: 32,
borderBottomRightRadius: 32,
}}
/>
<Button
text="Border Dashed"
style={{ borderStyle: 'dashed', borderWidth: 2, borderColor: 'red' }}
/>
<Button
text="Border Dotted"
style={{ borderStyle: 'dotted', borderWidth: 2, borderColor: 'red' }}
/>
<Button
text="Border Solid"
style={{ borderStyle: 'solid', borderWidth: 2, borderColor: 'red' }}
/>
</View>
);
}
type ButtonProps = {
// RN cross-version conflicts prevent us from using `ViewStyle` with RNGH <= 2.21.0 and RN >= 0.75.0
style: Record<string, string | number>;
text: string;
};
function Button({ style, text }: ButtonProps) {
const rectButtonStyles = [styles.button, style];
// eslint-disable-next-line no-alert
const onPress = () => alert(`Pressed ${text}!`);
return (
<RectButton style={rectButtonStyles} onPress={onPress}>
<Text style={styles.text}>{text}</Text>
</RectButton>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'row',
gap: 8,
flexWrap: 'wrap',
justifyContent: 'center',
alignContent: 'center',
},
button: {
width: 100,
height: 100,
backgroundColor: '#782aeb',
justifyContent: 'center',
alignItems: 'center',
padding: 8,
borderWidth: 1,
borderColor: '#001a72',
},
text: {
color: '#f8f9ff',
textAlign: 'center',
},
});