Skip to content

Commit 9def2c0

Browse files
committed
Rename component
1 parent 3d91d6e commit 9def2c0

1 file changed

Lines changed: 52 additions & 54 deletions

File tree

apps/basic-example/src/ContentsButton.tsx

Lines changed: 52 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import {
66
RectButton,
77
} from 'react-native-gesture-handler';
88

9-
const MyButton = RectButton;
10-
119
export default function ComplexUI() {
1210
return (
1311
<GestureHandlerRootView style={styles.container}>
@@ -36,11 +34,11 @@ function Avatars() {
3634
return (
3735
<ScrollView horizontal showsHorizontalScrollIndicator={false}>
3836
{colors.map((color) => (
39-
<MyButton
37+
<RectButton
4038
key={color}
4139
style={[styles.avatars, { backgroundColor: color }]}>
4240
<Text style={styles.avatarLabel}>{color.slice(1, 3)}</Text>
43-
</MyButton>
41+
</RectButton>
4442
))}
4543
</ScrollView>
4644
);
@@ -51,12 +49,12 @@ function Gallery() {
5149
<View style={[styles.section]}>
5250
<Text style={styles.sectionTitle}>Basic Gallery</Text>
5351
<View style={[styles.gap]}>
54-
<MyButton style={styles.fullWidthButton} />
52+
<RectButton style={styles.fullWidthButton} />
5553
<View style={[styles.row, styles.gap]}>
56-
<MyButton style={styles.leftButton} />
57-
<MyButton style={styles.rightButton} />
54+
<RectButton style={styles.leftButton} />
55+
<RectButton style={styles.rightButton} />
5856
</View>
59-
<MyButton style={[styles.fullWidthButton, { borderRadius: 20 }]} />
57+
<RectButton style={[styles.fullWidthButton, { borderRadius: 20 }]} />
6058
</View>
6159
</View>
6260
);
@@ -67,15 +65,15 @@ function SizeConstraints() {
6765
<View style={styles.section}>
6866
<Text style={styles.sectionTitle}>Size Constraints</Text>
6967
<View style={[styles.row, styles.gap]}>
70-
<MyButton style={styles.minMaxButton}>
68+
<RectButton style={styles.minMaxButton}>
7169
<Text style={styles.buttonText}>Min/Max</Text>
72-
</MyButton>
73-
<MyButton style={styles.aspectRatioButton}>
70+
</RectButton>
71+
<RectButton style={styles.aspectRatioButton}>
7472
<Text style={styles.buttonText}>1:1</Text>
75-
</MyButton>
76-
<MyButton style={styles.flexGrowButton}>
73+
</RectButton>
74+
<RectButton style={styles.flexGrowButton}>
7775
<Text style={styles.buttonText}>Flex</Text>
78-
</MyButton>
76+
</RectButton>
7977
</View>
8078
</View>
8179
);
@@ -86,29 +84,29 @@ function FlexboxTests() {
8684
<View style={styles.section}>
8785
<Text style={styles.sectionTitle}>Flexbox Layouts</Text>
8886
<View style={styles.flexContainer}>
89-
<MyButton style={styles.flexStart}>
87+
<RectButton style={styles.flexStart}>
9088
<Text style={styles.buttonText}>Start</Text>
91-
</MyButton>
92-
<MyButton style={styles.flexCenter}>
89+
</RectButton>
90+
<RectButton style={styles.flexCenter}>
9391
<Text style={styles.buttonText}>Center</Text>
94-
</MyButton>
95-
<MyButton style={styles.flexEnd}>
92+
</RectButton>
93+
<RectButton style={styles.flexEnd}>
9694
<Text style={styles.buttonText}>End</Text>
97-
</MyButton>
95+
</RectButton>
9896
</View>
9997
<View style={styles.flexWrapContainer}>
100-
<MyButton style={styles.wrapItem}>
98+
<RectButton style={styles.wrapItem}>
10199
<Text style={styles.buttonText}>Wrap 1</Text>
102-
</MyButton>
103-
<MyButton style={styles.wrapItem}>
100+
</RectButton>
101+
<RectButton style={styles.wrapItem}>
104102
<Text style={styles.buttonText}>Wrap 2</Text>
105-
</MyButton>
106-
<MyButton style={styles.wrapItem}>
103+
</RectButton>
104+
<RectButton style={styles.wrapItem}>
107105
<Text style={styles.buttonText}>Wrap 3</Text>
108-
</MyButton>
109-
<MyButton style={styles.wrapItem}>
106+
</RectButton>
107+
<RectButton style={styles.wrapItem}>
110108
<Text style={styles.buttonText}>Wrap 4</Text>
111-
</MyButton>
109+
</RectButton>
112110
</View>
113111
</View>
114112
);
@@ -119,15 +117,15 @@ function PositioningTests() {
119117
<View style={styles.section}>
120118
<Text style={styles.sectionTitle}>Positioning</Text>
121119
<View style={styles.positionContainer}>
122-
<MyButton style={styles.zIndexButton}>
120+
<RectButton style={styles.zIndexButton}>
123121
<Text style={styles.buttonText}>Z-Index</Text>
124-
</MyButton>
125-
<MyButton style={styles.absoluteButton}>
122+
</RectButton>
123+
<RectButton style={styles.absoluteButton}>
126124
<Text style={styles.buttonText}>Absolute</Text>
127-
</MyButton>
128-
<MyButton style={styles.relativeButton}>
125+
</RectButton>
126+
<RectButton style={styles.relativeButton}>
129127
<Text style={styles.buttonText}>Relative</Text>
130-
</MyButton>
128+
</RectButton>
131129
</View>
132130
</View>
133131
);
@@ -138,15 +136,15 @@ function SpacingTests() {
138136
<View style={styles.section}>
139137
<Text style={styles.sectionTitle}>Spacing & Overflow</Text>
140138
<View style={[styles.row, styles.gap]}>
141-
<MyButton style={styles.paddingButton}>
139+
<RectButton style={styles.paddingButton}>
142140
<Text style={styles.buttonText}>Padding</Text>
143-
</MyButton>
144-
<MyButton style={styles.marginButton}>
141+
</RectButton>
142+
<RectButton style={styles.marginButton}>
145143
<Text style={styles.buttonText}>Margin</Text>
146-
</MyButton>
147-
<MyButton style={styles.overflowButton}>
144+
</RectButton>
145+
<RectButton style={styles.overflowButton}>
148146
<Text style={styles.longText}>Overflow Hidden Test</Text>
149-
</MyButton>
147+
</RectButton>
150148
</View>
151149
</View>
152150
);
@@ -157,12 +155,12 @@ function VisualEffects() {
157155
<View style={styles.section}>
158156
<Text style={styles.sectionTitle}>Visual Effects</Text>
159157
<View style={[styles.row, styles.gap]}>
160-
<MyButton style={styles.shadowButton}>
158+
<RectButton style={styles.shadowButton}>
161159
<Text style={styles.buttonText}>Shadow</Text>
162-
</MyButton>
163-
<MyButton style={styles.opacityButton}>
160+
</RectButton>
161+
<RectButton style={styles.opacityButton}>
164162
<Text style={styles.buttonText}>Opacity</Text>
165-
</MyButton>
163+
</RectButton>
166164
</View>
167165
</View>
168166
);
@@ -173,18 +171,18 @@ function ComplexCombinations() {
173171
<View style={styles.section}>
174172
<Text style={styles.sectionTitle}>Complex Combinations</Text>
175173
<View style={styles.complexGrid}>
176-
<MyButton style={styles.complexButton1}>
174+
<RectButton style={styles.complexButton1}>
177175
<Text style={styles.buttonText}>Complex 1</Text>
178-
</MyButton>
179-
<MyButton style={styles.complexButton2}>
176+
</RectButton>
177+
<RectButton style={styles.complexButton2}>
180178
<Text style={styles.buttonText}>Complex 2</Text>
181-
</MyButton>
182-
<MyButton style={styles.complexButton3}>
179+
</RectButton>
180+
<RectButton style={styles.complexButton3}>
183181
<Text style={styles.buttonText}>Complex 3</Text>
184-
</MyButton>
185-
<MyButton style={styles.complexButton4}>
182+
</RectButton>
183+
<RectButton style={styles.complexButton4}>
186184
<Text style={styles.buttonText}>Complex 4</Text>
187-
</MyButton>
185+
</RectButton>
188186
</View>
189187
</View>
190188
);
@@ -195,9 +193,9 @@ function Transforms() {
195193
<View style={styles.section}>
196194
<Text style={styles.sectionTitle}>Transform</Text>
197195
<View style={styles.complexGrid}>
198-
<MyButton style={styles.transformButton}>
196+
<RectButton style={styles.transformButton}>
199197
<Text style={styles.buttonText}>Transform</Text>
200-
</MyButton>
198+
</RectButton>
201199
</View>
202200
</View>
203201
);

0 commit comments

Comments
 (0)