From d6b42f36bc65b8d5085495648bd6af40b1e7e290 Mon Sep 17 00:00:00 2001 From: YoussefFouadd Date: Sun, 10 Nov 2024 19:12:36 +0200 Subject: [PATCH] Adding buttons to the sample app --- .../src/screens/BugReportingScreen.tsx | 64 ++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/examples/default/src/screens/BugReportingScreen.tsx b/examples/default/src/screens/BugReportingScreen.tsx index 95a8505699..a8afc14a8d 100644 --- a/examples/default/src/screens/BugReportingScreen.tsx +++ b/examples/default/src/screens/BugReportingScreen.tsx @@ -1,11 +1,20 @@ import React from 'react'; -import Instabug, { BugReporting, InvocationOption, ReportType } from 'instabug-reactnative'; +import Instabug, { + BugReporting, + InvocationOption, + ReportType, + ExtendedBugReportMode, + WelcomeMessageMode, +} from 'instabug-reactnative'; import { ListTile } from '../components/ListTile'; import { Screen } from '../components/Screen'; +import { useToast } from 'native-base'; +import { Section } from '../components/Section'; export const BugReportingScreen: React.FC = () => { + const toast = useToast(); return ( Instabug.show()} /> @@ -15,6 +24,59 @@ export const BugReportingScreen: React.FC = () => { onPress={() => BugReporting.show(ReportType.feedback, [InvocationOption.emailFieldHidden])} /> BugReporting.show(ReportType.question, [])} /> + + BugReporting.setExtendedBugReportMode(ExtendedBugReportMode.enabledWithRequiredFields) + } + /> + + BugReporting.setExtendedBugReportMode(ExtendedBugReportMode.enabledWithOptionalFields) + } + /> + Instabug.setSessionProfilerEnabled(true)} + /> + Instabug.showWelcomeMessage(WelcomeMessageMode.beta)} + /> + Instabug.showWelcomeMessage(WelcomeMessageMode.live)} + /> + +
+ + BugReporting.onInvokeHandler(function () { + Instabug.appendTags(['Invocation Handler tag1']); + }) + } + /> + + Instabug.onReportSubmitHandler(() => { + toast.show({ + description: 'Submission succeeded', + }); + }) + } + /> + + BugReporting.onSDKDismissedHandler(function () { + Instabug.setPrimaryColor('#FF0000'); + }) + } + /> +
); };