Skip to content

Commit 902ed27

Browse files
a7medevHeshamMegid
authored andcommitted
feat(example): add user steps demos (#1047)
Jira ID: IBGCRASH-20289
1 parent 39d1c54 commit 902ed27

19 files changed

+623
-10
lines changed

examples/default/babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
22
presets: ['module:metro-react-native-babel-preset'],
3+
plugins: ['react-native-reanimated/plugin'],
34
};

examples/default/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'react-native-gesture-handler';
12
import { AppRegistry } from 'react-native';
23

34
import { name as appName } from './app.json';

examples/default/ios/Podfile.lock

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,8 @@ PODS:
379379
- glog
380380
- react-native-safe-area-context (4.7.1):
381381
- React-Core
382+
- react-native-slider (4.4.3):
383+
- React-Core
382384
- React-NativeModulesApple (0.72.3):
383385
- hermes-engine
384386
- React-callinvoker
@@ -489,9 +491,41 @@ PODS:
489491
- React-jsi (= 0.72.3)
490492
- React-logger (= 0.72.3)
491493
- React-perflogger (= 0.72.3)
494+
- RNGestureHandler (2.13.4):
495+
- RCT-Folly (= 2021.07.22.00)
496+
- React-Core
492497
- RNInstabug (12.4.0):
493498
- Instabug (= 12.4.0)
494499
- React-Core
500+
- RNReanimated (3.5.4):
501+
- DoubleConversion
502+
- FBLazyVector
503+
- glog
504+
- hermes-engine
505+
- RCT-Folly
506+
- RCTRequired
507+
- RCTTypeSafety
508+
- React-callinvoker
509+
- React-Core
510+
- React-Core/DevSupport
511+
- React-Core/RCTWebSocket
512+
- React-CoreModules
513+
- React-cxxreact
514+
- React-hermes
515+
- React-jsi
516+
- React-jsiexecutor
517+
- React-jsinspector
518+
- React-RCTActionSheet
519+
- React-RCTAnimation
520+
- React-RCTAppDelegate
521+
- React-RCTBlob
522+
- React-RCTImage
523+
- React-RCTLinking
524+
- React-RCTNetwork
525+
- React-RCTSettings
526+
- React-RCTText
527+
- ReactCommon/turbomodule/core
528+
- Yoga
495529
- RNScreens (3.24.0):
496530
- React-Core
497531
- React-RCTImage
@@ -552,6 +586,7 @@ DEPENDENCIES:
552586
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
553587
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
554588
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
589+
- "react-native-slider (from `../node_modules/@react-native-community/slider`)"
555590
- React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
556591
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
557592
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
@@ -569,7 +604,9 @@ DEPENDENCIES:
569604
- React-runtimescheduler (from `../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler`)
570605
- React-utils (from `../node_modules/react-native/ReactCommon/react/utils`)
571606
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
607+
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
572608
- RNInstabug (from `../node_modules/instabug-reactnative`)
609+
- RNReanimated (from `../node_modules/react-native-reanimated`)
573610
- RNScreens (from `../node_modules/react-native-screens`)
574611
- RNSVG (from `../node_modules/react-native-svg`)
575612
- RNVectorIcons (from `../node_modules/react-native-vector-icons`)
@@ -640,6 +677,8 @@ EXTERNAL SOURCES:
640677
:path: "../node_modules/react-native/ReactCommon/logger"
641678
react-native-safe-area-context:
642679
:path: "../node_modules/react-native-safe-area-context"
680+
react-native-slider:
681+
:path: "../node_modules/@react-native-community/slider"
643682
React-NativeModulesApple:
644683
:path: "../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios"
645684
React-perflogger:
@@ -674,8 +713,12 @@ EXTERNAL SOURCES:
674713
:path: "../node_modules/react-native/ReactCommon/react/utils"
675714
ReactCommon:
676715
:path: "../node_modules/react-native/ReactCommon"
716+
RNGestureHandler:
717+
:path: "../node_modules/react-native-gesture-handler"
677718
RNInstabug:
678719
:path: "../node_modules/instabug-reactnative"
720+
RNReanimated:
721+
:path: "../node_modules/react-native-reanimated"
679722
RNScreens:
680723
:path: "../node_modules/react-native-screens"
681724
RNSVG:
@@ -722,6 +765,7 @@ SPEC CHECKSUMS:
722765
React-jsinspector: b511447170f561157547bc0bef3f169663860be7
723766
React-logger: c5b527272d5f22eaa09bb3c3a690fee8f237ae95
724767
react-native-safe-area-context: 9697629f7b2cda43cf52169bb7e0767d330648c2
768+
react-native-slider: 1cdd6ba29675df21f30544253bf7351d3c2d68c4
725769
React-NativeModulesApple: c57f3efe0df288a6532b726ad2d0322a9bf38472
726770
React-perflogger: 6bd153e776e6beed54c56b0847e1220a3ff92ba5
727771
React-RCTActionSheet: c0b62af44e610e69d9a2049a682f5dba4e9dff17
@@ -739,7 +783,9 @@ SPEC CHECKSUMS:
739783
React-runtimescheduler: 837c1bebd2f84572db17698cd702ceaf585b0d9a
740784
React-utils: bcb57da67eec2711f8b353f6e3d33bd8e4b2efa3
741785
ReactCommon: 3ccb8fb14e6b3277e38c73b0ff5e4a1b8db017a9
786+
RNGestureHandler: 6e46dde1f87e5f018a54fe5d40cd0e0b942b49ee
742787
RNInstabug: ae604474d8e74d7bd2bee96ccbcfd9d7e12a61fe
788+
RNReanimated: ab2e96c6d5591c3dfbb38a464f54c8d17fb34a87
743789
RNScreens: b21dc57dfa2b710c30ec600786a3fc223b1b92e7
744790
RNSVG: 80584470ff1ffc7994923ea135a3e5ad825546b9
745791
RNVectorIcons: 8b5bb0fa61d54cd2020af4f24a51841ce365c7e9

examples/default/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@
99
"lint": "eslint ."
1010
},
1111
"dependencies": {
12+
"@react-native-community/slider": "^4.4.3",
1213
"@react-navigation/bottom-tabs": "^6.5.7",
1314
"@react-navigation/native": "^6.1.6",
1415
"@react-navigation/native-stack": "^6.9.12",
1516
"instabug-reactnative": "link:../..",
1617
"native-base": "^3.4.28",
1718
"react": "18.2.0",
1819
"react-native": "0.72.3",
20+
"react-native-gesture-handler": "^2.13.4",
21+
"react-native-reanimated": "^3.5.4",
1922
"react-native-safe-area-context": "^4.5.3",
2023
"react-native-screens": "^3.20.0",
2124
"react-native-svg": "^13.9.0",

examples/default/src/App.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React, { useEffect } from 'react';
2+
import { StyleSheet } from 'react-native';
23

4+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
35
import { NavigationContainer } from '@react-navigation/native';
46
import Instabug, { InvocationEvent, LogLevel } from 'instabug-reactnative';
57
import { NativeBaseProvider } from 'native-base';
@@ -18,10 +20,18 @@ export const App: React.FC = () => {
1820
}, []);
1921

2022
return (
21-
<NativeBaseProvider theme={nativeBaseTheme}>
22-
<NavigationContainer onStateChange={Instabug.onStateChange} theme={navigationTheme}>
23-
<RootTabNavigator />
24-
</NavigationContainer>
25-
</NativeBaseProvider>
23+
<GestureHandlerRootView style={styles.root}>
24+
<NativeBaseProvider theme={nativeBaseTheme}>
25+
<NavigationContainer onStateChange={Instabug.onStateChange} theme={navigationTheme}>
26+
<RootTabNavigator />
27+
</NavigationContainer>
28+
</NativeBaseProvider>
29+
</GestureHandlerRootView>
2630
);
2731
};
32+
33+
const styles = StyleSheet.create({
34+
root: {
35+
flex: 1,
36+
},
37+
});

examples/default/src/components/Screen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { VStack } from 'native-base';
44

55
export const Screen: React.FC<PropsWithChildren> = ({ children }) => {
66
return (
7-
<VStack alignItems="stretch" padding="2">
7+
<VStack alignItems="stretch" padding="2" flex={1}>
88
{children}
99
</VStack>
1010
);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react';
2+
import { Heading, VStack } from 'native-base';
3+
4+
interface SectionProps {
5+
title: string;
6+
flex?: number;
7+
children?: React.ReactNode;
8+
}
9+
10+
export const Section: React.FC<SectionProps> = ({ title, flex, children }) => {
11+
return (
12+
<VStack marginBottom="4" flex={flex}>
13+
<Heading size="md" marginBottom="1.5">
14+
{title}
15+
</Heading>
16+
17+
{children}
18+
</VStack>
19+
);
20+
};

examples/default/src/images/logo.png

84.2 KB
Loading

examples/default/src/navigation/HomeStack.tsx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ import { FeatureRequestsScreen } from '../screens/FeatureRequestsScreen';
88
import { HomeScreen } from '../screens/HomeScreen';
99
import { RepliesScreen } from '../screens/RepliesScreen';
1010
import { SurveysScreen } from '../screens/SurveysScreen';
11+
import { UserStepsScreen } from '../screens/user-steps/UserStepsScreen';
12+
import { BasicComponentsScreen } from '../screens/user-steps/BasicComponentsScreen';
13+
import { ScrollViewScreen } from '../screens/user-steps/ScrollViewScreen';
14+
import { FlatListScreen } from '../screens/user-steps/FlatListScreen';
15+
import { SectionListScreen } from '../screens/user-steps/SectionListScreen';
16+
import { GesturesScreen } from '../screens/user-steps/GesturesScreen';
1117

1218
export type HomeStackParamList = {
1319
Home: undefined;
@@ -16,6 +22,12 @@ export type HomeStackParamList = {
1622
FeatureRequests: undefined;
1723
Replies: undefined;
1824
Surveys: undefined;
25+
UserSteps: undefined;
26+
BasicComponents: undefined;
27+
ScrollView: undefined;
28+
FlatList: undefined;
29+
SectionList: undefined;
30+
Gestures: undefined;
1931
};
2032

2133
const HomeStack = createNativeStackNavigator<HomeStackParamList>();
@@ -41,6 +53,32 @@ export const HomeStackNavigator: React.FC = () => {
4153
/>
4254
<HomeStack.Screen name="Replies" component={RepliesScreen} />
4355
<HomeStack.Screen name="Surveys" component={SurveysScreen} />
56+
<HomeStack.Screen
57+
name="UserSteps"
58+
component={UserStepsScreen}
59+
options={{ title: 'User Steps' }}
60+
/>
61+
<HomeStack.Screen
62+
name="BasicComponents"
63+
component={BasicComponentsScreen}
64+
options={{ title: 'Basic Components' }}
65+
/>
66+
<HomeStack.Screen
67+
name="ScrollView"
68+
component={ScrollViewScreen}
69+
options={{ title: 'Scroll View' }}
70+
/>
71+
<HomeStack.Screen
72+
name="FlatList"
73+
component={FlatListScreen}
74+
options={{ title: 'Flat List' }}
75+
/>
76+
<HomeStack.Screen
77+
name="SectionList"
78+
component={SectionListScreen}
79+
options={{ title: 'Section List' }}
80+
/>
81+
<HomeStack.Screen name="Gestures" component={GesturesScreen} />
4482
</HomeStack.Navigator>
4583
);
4684
};

examples/default/src/screens/HomeScreen.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const HomeScreen: React.FC<NativeStackScreenProps<HomeStackParamList, 'Ho
1616
<ListTile title="Feature Requests" onPress={() => navigation.navigate('FeatureRequests')} />
1717
<ListTile title="Replies" onPress={() => navigation.navigate('Replies')} />
1818
<ListTile title="Surveys" onPress={() => navigation.navigate('Surveys')} />
19+
<ListTile title="User Steps" onPress={() => navigation.navigate('UserSteps')} />
1920
</Screen>
2021
);
2122
};

0 commit comments

Comments
 (0)