Skip to content

Commit 1a03fd4

Browse files
feat(example): add repro-steps button samples
Added buttons for testing purposes.
1 parent ffa827a commit 1a03fd4

File tree

2 files changed

+49
-4
lines changed

2 files changed

+49
-4
lines changed

examples/default/src/App.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { StyleSheet } from 'react-native';
33

44
import { GestureHandlerRootView } from 'react-native-gesture-handler';
55
import { NavigationContainer } from '@react-navigation/native';
6-
import Instabug, { InvocationEvent, LogLevel } from 'instabug-reactnative';
6+
import Instabug, { InvocationEvent, LogLevel, ReproStepsMode } from 'instabug-reactnative';
77
import { NativeBaseProvider } from 'native-base';
88

99
import { RootTabNavigator } from './navigation/RootTab';
@@ -17,6 +17,10 @@ export const App: React.FC = () => {
1717
invocationEvents: [InvocationEvent.floatingButton],
1818
debugLogsLevel: LogLevel.verbose,
1919
});
20+
21+
Instabug.setReproStepsConfig({
22+
all: ReproStepsMode.enabled,
23+
});
2024
}, []);
2125

2226
return (

examples/default/src/screens/user-steps/BasicComponentsScreen.tsx

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ import {
1111
Switch,
1212
useWindowDimensions,
1313
ActivityIndicator,
14+
View,
1415
} from 'react-native';
1516
import Slider from '@react-native-community/slider';
1617
import { Center, HStack, ScrollView, VStack } from 'native-base';
1718

1819
import { Screen } from '../../components/Screen';
1920
import { Section } from '../../components/Section';
2021
import { nativeBaseTheme } from '../../theme/nativeBaseTheme';
22+
import Icon from 'react-native-vector-icons/Ionicons';
2123

2224
/**
23-
* A screen that demonstates the usage of user steps with basic React Native components.
25+
* A screen that demonstrates the usage of user steps with basic React Native components.
2426
*
2527
* This specific screen doesn't use NativeBase in some parts since we need to focus on
2628
* capturing React Native provided components rather than implementations built on top of it.
@@ -62,13 +64,51 @@ export const BasicComponentsScreen: React.FC = () => {
6264
<VStack space="xs">
6365
<Button onPress={onPress('Default Button')} title="Default Button" />
6466

65-
<Pressable onPress={onPress('Pressable Button')} style={styles.button}>
66-
<Text style={styles.buttonText}>Pressable Button</Text>
67+
<Pressable onPress={onPress('Icon Pressable Button')} style={styles.button}>
68+
<HStack space={2} alignItems="center" justifyContent="center">
69+
<Icon name="alert-circle-outline" color="white" />
70+
<Text style={styles.buttonText}>Icon Pressable Button</Text>
71+
</HStack>
6772
</Pressable>
6873

6974
<TouchableOpacity onPress={onPress('Touchable Opacity Button')} style={styles.button}>
7075
<Text style={styles.buttonText}>Touchable Button</Text>
7176
</TouchableOpacity>
77+
78+
<TouchableOpacity onPress={onPress('Touchable Opacity Button')} style={styles.button}>
79+
<Text style={styles.buttonText}>Touchable Button</Text>
80+
<Text style={styles.buttonText}>Multiple Texts</Text>
81+
</TouchableOpacity>
82+
83+
<Pressable onPress={onPress('Touchable Opacity Button')} style={styles.button}>
84+
<Text style={styles.buttonText}>Pressable Button</Text>
85+
<View>
86+
<HStack space={2} alignItems="center" justifyContent="center">
87+
<Icon name="alert-circle-outline" color="white" />
88+
<Text style={styles.buttonText}>Icon Pressable Button</Text>
89+
</HStack>
90+
</View>
91+
</Pressable>
92+
93+
<Icon.Button
94+
style={styles.button}
95+
name="alert-circle-outline"
96+
backgroundColor="#4A99E9"
97+
size={12}
98+
onPress={onPress('Icon.Button')}>
99+
<Text style={styles.buttonText}>Icon Button</Text>
100+
</Icon.Button>
101+
102+
<TouchableOpacity onPress={onPress('Touchable Opacity Button')} style={styles.button}>
103+
<Text style={styles.buttonText}>1 Tier</Text>
104+
<View>
105+
<View>
106+
<View>
107+
<Text style={styles.buttonText}>4 Tier Nested Button</Text>
108+
</View>
109+
</View>
110+
</View>
111+
</TouchableOpacity>
72112
</VStack>
73113
</Section>
74114

@@ -129,6 +169,7 @@ const styles = StyleSheet.create({
129169
formControlStyles.formControl,
130170
{
131171
backgroundColor: nativeBaseTheme.colors.primary[600],
172+
justifyContent: 'center',
132173
},
133174
]),
134175
});

0 commit comments

Comments
 (0)