Skip to content

Commit 9a30473

Browse files
authored
Use RNTesterText for example text on the page background (#59867)
1 parent e10397f commit 9a30473

29 files changed

Lines changed: 516 additions & 416 deletions

‎packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import {
3131
ScrollView,
3232
StyleSheet,
3333
Switch,
34-
Text,
3534
TextInput,
3635
TouchableNativeFeedback,
3736
TouchableOpacity,
@@ -2226,10 +2225,10 @@ function AriaHiddenExample(): React.Node {
22262225
aria-label={
22272226
ariaHidden ? 'This should be hidden' : 'This should be accessible'
22282227
}>
2229-
<Text>View with Text content</Text>
2228+
<RNTesterText>View with Text content</RNTesterText>
22302229
</View>
22312230

2232-
<Text aria-hidden={ariaHidden}>Regular Text</Text>
2231+
<RNTesterText aria-hidden={ariaHidden}>Regular Text</RNTesterText>
22332232

22342233
<TextInput
22352234
editable={false}
@@ -2258,7 +2257,7 @@ function AriaHiddenExample(): React.Node {
22582257
ariaHidden ? 'This should be hidden' : 'This should be accessible'
22592258
}
22602259
style={styles.button}>
2261-
<Text>Pressable with text content</Text>
2260+
<RNTesterText>Pressable with text content</RNTesterText>
22622261
</Pressable>
22632262

22642263
<Image

‎packages/rn-tester/js/examples/Animated/ColorStylesExample.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
1212

1313
import RNTConfigurationBlock from '../../components/RNTConfigurationBlock';
1414
import RNTesterButton from '../../components/RNTesterButton';
15+
import RNTesterText from '../../components/RNTesterText';
1516
import ToggleNativeDriver from './utils/ToggleNativeDriver';
1617
import * as React from 'react';
1718
import {useState} from 'react';
@@ -108,13 +109,13 @@ component AnimatedView(useNativeDriver: boolean) {
108109
style={[styles.animatedView, interpolationAnimatedStyle]}
109110
/>
110111
</View>
111-
<Text style={styles.animatedText}>
112+
<RNTesterText style={styles.animatedText}>
112113
<Text>The </Text>
113114
<Animated.Text style={animatedFirstSpanTextStyle}>quick</Animated.Text>
114115
<Text> brown </Text>
115116
<Animated.Text style={animatedSecondSpanTextStyle}>fox</Animated.Text>
116117
<Text> jumps over the lazy dog</Text>
117-
</Text>
118+
</RNTesterText>
118119
<Animated.Image
119120
style={[styles.animatedImage, animatedImageStyle]}
120121
source={require('../../assets/bunny.png')}

‎packages/rn-tester/js/examples/AnimationBackend/AllAnimatedPropsExample.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
1212

13+
import RNTesterText from '../../components/RNTesterText';
1314
import * as React from 'react';
1415
import {useMemo} from 'react';
1516
import {
@@ -67,16 +68,16 @@ function Row({
6768
}): React.Node {
6869
return (
6970
<View style={styles.row}>
70-
<Text style={styles.label} numberOfLines={2}>
71+
<RNTesterText style={styles.label} numberOfLines={2}>
7172
{label}
72-
</Text>
73+
</RNTesterText>
7374
<View style={styles.demo}>{children}</View>
7475
</View>
7576
);
7677
}
7778

7879
function SectionHeader({title}: {title: string}): React.Node {
79-
return <Text style={styles.section}>{title}</Text>;
80+
return <RNTesterText style={styles.section}>{title}</RNTesterText>;
8081
}
8182

8283
function FlagIndicator(): React.Node {

‎packages/rn-tester/js/examples/AnimationBackend/ChessboardExample.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010

1111
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
1212

13+
import RNTesterText from '../../components/RNTesterText';
1314
import * as React from 'react';
1415
import {useMemo} from 'react';
15-
import {Animated, StyleSheet, Text, View, useAnimatedValue} from 'react-native';
16+
import {Animated, StyleSheet, View, useAnimatedValue} from 'react-native';
1617

1718
const colors = ['lime', 'green'];
1819

@@ -76,7 +77,7 @@ function ChessboardExample() {
7677

7778
return (
7879
<View style={styles.workaround} collapsable={false}>
79-
<Text style={styles.text}>{state}</Text>
80+
<RNTesterText style={styles.text}>{state}</RNTesterText>
8081
<View style={styles.chessboard}>
8182
<View style={styles.border}>
8283
{[...Array(N).keys()].map(i => (

‎packages/rn-tester/js/examples/AnimationBackend/SwipeableListExample.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
1212

13+
import RNTesterText from '../../components/RNTesterText';
1314
import * as React from 'react';
1415
import {useCallback, useMemo, useRef} from 'react';
1516
import {
@@ -217,7 +218,7 @@ function ListItemContent({item}: {item: Data}): React.Node {
217218
<View style={styles.avatarContainer}>
218219
<Text style={styles.avatarText}>{item.title[0]}</Text>
219220
</View>
220-
<Text style={styles.title}>{item.title}</Text>
221+
<RNTesterText style={styles.title}>{item.title}</RNTesterText>
221222
</View>
222223
);
223224
}

‎packages/rn-tester/js/examples/BackgroundImage/BackgroundImageExample.js‎

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
1414

15+
import RNTesterText from '../../components/RNTesterText';
1516
import {StyleSheet, Text, View} from 'react-native';
1617

1718
type ViewStyleProp = NonNullable<React.PropOf<View, 'style'>>;
@@ -83,7 +84,7 @@ exports.examples = [
8384
return (
8485
<View style={styles.row}>
8586
<View style={styles.col}>
86-
<Text>45deg</Text>
87+
<RNTesterText>45deg</RNTesterText>
8788
<BackgroundImageBox
8889
style={{
8990
backgroundImage: 'linear-gradient(45deg, #ff6b6b, #4ecdc4)',
@@ -92,7 +93,7 @@ exports.examples = [
9293
/>
9394
</View>
9495
<View style={styles.col}>
95-
<Text>90deg</Text>
96+
<RNTesterText>90deg</RNTesterText>
9697
<BackgroundImageBox
9798
style={{
9899
backgroundImage: 'linear-gradient(90deg, #a8edea, #fed6e3)',
@@ -101,7 +102,7 @@ exports.examples = [
101102
/>
102103
</View>
103104
<View style={styles.col}>
104-
<Text>180deg</Text>
105+
<RNTesterText>180deg</RNTesterText>
105106
<BackgroundImageBox
106107
style={{
107108
backgroundImage: 'linear-gradient(180deg, #ffecd2, #fcb69f)',
@@ -120,7 +121,7 @@ exports.examples = [
120121
return (
121122
<View style={styles.row}>
122123
<View style={styles.col}>
123-
<Text>3 colors</Text>
124+
<RNTesterText>3 colors</RNTesterText>
124125
<BackgroundImageBox
125126
style={{
126127
backgroundImage:
@@ -130,7 +131,7 @@ exports.examples = [
130131
/>
131132
</View>
132133
<View style={styles.col}>
133-
<Text>4 colors</Text>
134+
<RNTesterText>4 colors</RNTesterText>
134135
<BackgroundImageBox
135136
style={{
136137
backgroundImage:
@@ -140,7 +141,7 @@ exports.examples = [
140141
/>
141142
</View>
142143
<View style={styles.col}>
143-
<Text>Rainbow</Text>
144+
<RNTesterText>Rainbow</RNTesterText>
144145
<BackgroundImageBox
145146
style={{
146147
backgroundImage:
@@ -160,7 +161,7 @@ exports.examples = [
160161
return (
161162
<View style={styles.row}>
162163
<View style={styles.col}>
163-
<Text>Circle</Text>
164+
<RNTesterText>Circle</RNTesterText>
164165
<BackgroundImageBox
165166
style={{
166167
backgroundImage: 'radial-gradient(circle, #ff6b6b, #4ecdc4)',
@@ -169,7 +170,7 @@ exports.examples = [
169170
/>
170171
</View>
171172
<View style={styles.col}>
172-
<Text>Ellipse</Text>
173+
<RNTesterText>Ellipse</RNTesterText>
173174
<BackgroundImageBox
174175
style={{
175176
backgroundImage: 'radial-gradient(ellipse, #a8edea, #fed6e3)',
@@ -189,7 +190,7 @@ exports.examples = [
189190
<View>
190191
<View style={styles.row}>
191192
<View style={styles.col}>
192-
<Text>repeat</Text>
193+
<RNTesterText>repeat</RNTesterText>
193194
<BackgroundImageBox
194195
style={{
195196
width: 200,
@@ -203,7 +204,7 @@ exports.examples = [
203204
/>
204205
</View>
205206
<View style={styles.col}>
206-
<Text>space</Text>
207+
<RNTesterText>space</RNTesterText>
207208
<BackgroundImageBox
208209
style={{
209210
width: 200,
@@ -218,7 +219,7 @@ exports.examples = [
218219
</View>
219220
<View style={styles.row}>
220221
<View style={styles.col}>
221-
<Text>round</Text>
222+
<RNTesterText>round</RNTesterText>
222223
<BackgroundImageBox
223224
style={{
224225
width: 200,
@@ -231,7 +232,7 @@ exports.examples = [
231232
/>
232233
</View>
233234
<View style={styles.col}>
234-
<Text>no-repeat</Text>
235+
<RNTesterText>no-repeat</RNTesterText>
235236
<BackgroundImageBox
236237
style={{
237238
width: 200,
@@ -256,7 +257,7 @@ exports.examples = [
256257
return (
257258
<View style={styles.row}>
258259
<View style={styles.col}>
259-
<Text>center</Text>
260+
<RNTesterText>center</RNTesterText>
260261
<BackgroundImageBox
261262
style={{
262263
backgroundImage: 'radial-gradient(circle, #ff6b6b, #4ecdc4)',
@@ -269,7 +270,7 @@ exports.examples = [
269270
/>
270271
</View>
271272
<View style={styles.col}>
272-
<Text>25% 75%</Text>
273+
<RNTesterText>25% 75%</RNTesterText>
273274
<BackgroundImageBox
274275
style={{
275276
backgroundImage: 'radial-gradient(circle, #a8edea, #fed6e3)',
@@ -282,7 +283,7 @@ exports.examples = [
282283
/>
283284
</View>
284285
<View style={styles.col}>
285-
<Text>right bottom</Text>
286+
<RNTesterText>right bottom</RNTesterText>
286287
<BackgroundImageBox
287288
style={{
288289
backgroundImage: 'radial-gradient(circle, #ffecd2, #fcb69f)',
@@ -346,7 +347,7 @@ exports.examples = [
346347
return (
347348
<View style={styles.row}>
348349
<View style={styles.col}>
349-
<Text>borderRadius</Text>
350+
<RNTesterText>borderRadius</RNTesterText>
350351
<BackgroundImageBox
351352
style={{
352353
backgroundImage: 'linear-gradient(45deg, #667eea, #764ba2)',
@@ -356,7 +357,7 @@ exports.examples = [
356357
/>
357358
</View>
358359
<View style={styles.col}>
359-
<Text>borderWidth + borderColor</Text>
360+
<RNTesterText>borderWidth + borderColor</RNTesterText>
360361
<BackgroundImageBox
361362
style={{
362363
backgroundImage: 'radial-gradient(circle, #f093fb, #f5576c)',
@@ -367,7 +368,7 @@ exports.examples = [
367368
/>
368369
</View>
369370
<View style={styles.col}>
370-
<Text>non uniform borderRadius</Text>
371+
<RNTesterText>non uniform borderRadius</RNTesterText>
371372
<BackgroundImageBox
372373
style={{
373374
backgroundImage: 'radial-gradient(circle, #f093fb, #f5576c)',
@@ -380,7 +381,7 @@ exports.examples = [
380381
/>
381382
</View>
382383
<View style={styles.col}>
383-
<Text>non uniform borderWidth</Text>
384+
<RNTesterText>non uniform borderWidth</RNTesterText>
384385
<BackgroundImageBox
385386
style={{
386387
backgroundImage: 'radial-gradient(circle, #f093fb, #f5576c)',

‎packages/rn-tester/js/examples/Cursor/CursorExample.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010

1111
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
1212

13+
import RNTesterText from '../../components/RNTesterText';
1314
import * as React from 'react';
14-
import {StyleSheet, Text, View} from 'react-native';
15+
import {StyleSheet, View} from 'react-native';
1516

1617
const styles = StyleSheet.create({
1718
invisibleBox: {
@@ -83,7 +84,7 @@ function CursorExampleViewFlattening(): React.Node {
8384
return (
8485
<View style={styles.row}>
8586
<View style={[styles.invisibleBox, styles.centerContent, styles.pointer]}>
86-
<Text>pointer</Text>
87+
<RNTesterText>pointer</RNTesterText>
8788
</View>
8889
</View>
8990
);

‎packages/rn-tester/js/examples/DrawerLayoutAndroid/DrawerLayoutAndroidExample.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
1414
import type {Node} from 'react';
1515

16+
import RNTesterText from '../../components/RNTesterText';
1617
import {RNTesterThemeContext} from '../../components/RNTesterTheme';
1718
import * as React from 'react';
1819
import {useContext, useRef, useState} from 'react';
@@ -64,9 +65,9 @@ const Drawer = () => {
6465
title="Change Drawer Position"
6566
onPress={() => changeDrawerPosition()}
6667
/>
67-
<Text style={styles.paragraph}>
68+
<RNTesterText style={styles.paragraph}>
6869
Swipe from the side or press button below to see it!
69-
</Text>
70+
</RNTesterText>
7071
<Button
7172
title="Open drawer"
7273
/* $FlowFixMe[incompatible-use] */

‎packages/rn-tester/js/examples/Experimental/Compatibility/ManyPointersPropertiesExample.js‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
import type {RNTesterModuleExample} from '../../../types/RNTesterTypes';
1212
import type {PointerEvent} from 'react-native';
1313

14+
import RNTesterText from '../../../components/RNTesterText';
1415
import * as React from 'react';
1516
import {useState} from 'react';
16-
import {StyleSheet, Text, View} from 'react-native';
17+
import {StyleSheet, View} from 'react-native';
1718

1819
const styles = StyleSheet.create({
1920
container: {height: '30%', width: '100%', backgroundColor: 'black'},
@@ -60,22 +61,22 @@ function ManyPointersPropertiesExample(): React.Node {
6061
//$FlowFixMe[incompatible-type] can't supply generic for Object.entries
6162
([key, evt]: [string, PointerEvent['nativeEvent']]) => (
6263
<View style={styles.property} key={key}>
63-
<Text>PointerID: {evt.pointerId}</Text>
64-
<Text>
64+
<RNTesterText>PointerID: {evt.pointerId}</RNTesterText>
65+
<RNTesterText>
6566
Offset: [{evt.offsetX.toPrecision(3)},{' '}
6667
{evt.offsetY.toPrecision(3)}]
67-
</Text>
68-
<Text>
68+
</RNTesterText>
69+
<RNTesterText>
6970
Coordinates: [{evt.clientX.toPrecision(3)},{' '}
7071
{evt.clientY.toPrecision(3)}]
71-
</Text>
72-
<Text>
72+
</RNTesterText>
73+
<RNTesterText>
7374
Screen Coordinates: [{evt.screenX?.toPrecision(3)},{' '}
7475
{evt.screenY?.toPrecision(3)}]
75-
</Text>
76-
<Text>Button: {evt.button}</Text>
77-
<Text>Pressure: {evt.pressure}</Text>
78-
<Text>Modifiers: {getModifiersText(evt)}</Text>
76+
</RNTesterText>
77+
<RNTesterText>Button: {evt.button}</RNTesterText>
78+
<RNTesterText>Pressure: {evt.pressure}</RNTesterText>
79+
<RNTesterText>Modifiers: {getModifiersText(evt)}</RNTesterText>
7980
</View>
8081
),
8182
)}

0 commit comments

Comments
 (0)