shakebug-react-native 2.3.7 → 2.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shakebug-react-native",
3
3
  "title": "shakebug-react-native",
4
- "version": "2.3.7",
4
+ "version": "2.3.8",
5
5
  "description": "Shakebug allows users to report the bug from your mobile phone for your application. Here users just need to shake their mobile and all the data regarding bugs & crashes can be seen by developers through their log in panel easily",
6
6
  "main": "src/index.tsx",
7
7
  "scripts": {
@@ -1,21 +1,8 @@
1
- import React, { useState } from 'react';
2
- import { View, Text, Button, StyleSheet, Modal, TouchableOpacity, ScrollView, Clipboard, Platform } from 'react-native';
1
+ import React from 'react';
2
+ import { View, Text, Button, StyleSheet, Modal, TouchableOpacity } from 'react-native';
3
3
 
4
- const CustomeAlert = ({color, isVisible, OnPrees, text, showCopyOption}) => {
4
+ const CustomeAlert = ({color, isVisible, OnPrees, text}) => {
5
5
 
6
- const [copied, setCopied] = useState(false);
7
-
8
- const handleCopy = () => {
9
- Clipboard.setString(text);
10
- setCopied(true);
11
- setTimeout(() => setCopied(false), 2000);
12
- };
13
-
14
- const handleClose = () => {
15
- setCopied(false);
16
- OnPrees();
17
- };
18
-
19
6
  return (
20
7
  <Modal
21
8
  transparent={true}
@@ -30,58 +17,30 @@ const CustomeAlert = ({color, isVisible, OnPrees, text, showCopyOption}) => {
30
17
  height: text.length > 120 ? 300 : text.length < 50 ? 170 : 200
31
18
  }]}
32
19
  >
33
- {showCopyOption ? (
34
- <ScrollView
35
- style={styles.scrollContainer}
36
- contentContainerStyle={styles.scrollContent}
37
- showsVerticalScrollIndicator={true}
38
- >
39
- <Text style={styles.errorText} selectable={true}>
40
- {text}
41
- </Text>
42
- </ScrollView>
43
- ) : (
44
- <Text style={styles.text}>
45
- {text}
46
- </Text>
47
- )}
48
-
49
- {showCopyOption ? (
50
- <View style={styles.buttonRow}>
51
- <TouchableOpacity
52
- style={[styles.button, { backgroundColor: '#6c757d', marginRight: 10 }]}
53
- onPress={handleCopy}
54
- >
55
- <Text style={styles.buttonText}>
56
- {copied ? '✓ Copied' : '📋 Copy'}
57
- </Text>
58
- </TouchableOpacity>
59
- <TouchableOpacity
60
- style={[styles.button, { backgroundColor: color }]}
61
- onPress={handleClose}
62
- >
63
- <Text style={styles.buttonText}>
64
- Okay
65
- </Text>
66
- </TouchableOpacity>
67
- </View>
68
- ) : (
69
- <TouchableOpacity
20
+ <Text style={styles.text}>
21
+ {text}
22
+ </Text>
23
+
24
+ <TouchableOpacity
25
+ style={{
26
+ width: '100%',
27
+ backgroundColor: color,
28
+ height: 40,
29
+ alignItems: 'center',
30
+ justifyContent: 'center',
31
+ borderRadius: 8
32
+ }}
33
+ onPress={OnPrees}
34
+ >
35
+ <Text
70
36
  style={{
71
- width: '100%',
72
- backgroundColor: color,
73
- height: 40,
74
- alignItems: 'center',
75
- justifyContent: 'center',
76
- borderRadius: 8
37
+ fontSize: 16,
38
+ color: "#fff"
77
39
  }}
78
- onPress={handleClose}
79
40
  >
80
- <Text style={styles.buttonText}>
81
- Okay
82
- </Text>
83
- </TouchableOpacity>
84
- )}
41
+ Okay
42
+ </Text>
43
+ </TouchableOpacity>
85
44
  </View>
86
45
  </View>
87
46
  </Modal>
@@ -116,40 +75,6 @@ const styles = StyleSheet.create({
116
75
  textAlign: 'center',
117
76
  color: "#000"
118
77
  },
119
- scrollContainer: {
120
- maxHeight: 140,
121
- width: '100%',
122
- backgroundColor: '#f8f9fa',
123
- borderRadius: 8,
124
- borderWidth: 1,
125
- borderColor: '#dee2e6',
126
- },
127
- scrollContent: {
128
- padding: 12,
129
- },
130
- errorText: {
131
- fontSize: 13,
132
- color: '#dc3545',
133
- lineHeight: 18,
134
- fontFamily: Platform.OS === 'ios' ? 'Menlo' : 'monospace',
135
- },
136
- buttonRow: {
137
- flexDirection: 'row',
138
- width: '100%',
139
- justifyContent: 'center',
140
- marginTop: 10,
141
- },
142
- button: {
143
- flex: 1,
144
- height: 40,
145
- alignItems: 'center',
146
- justifyContent: 'center',
147
- borderRadius: 8,
148
- },
149
- buttonText: {
150
- fontSize: 16,
151
- color: '#fff',
152
- },
153
78
  });
154
79
 
155
80
  export default CustomeAlert;
@@ -490,27 +490,26 @@ const ShakeFunction = ({ children, themeColor, showTutorialScreen, SDKScreenTitl
490
490
  >
491
491
 
492
492
  <ShakebugCapture ref={ref} options={{ format: "jpg", quality: 1, }} style={{ flex: 1 }}>
493
- {isDraw ? (
494
- <ImageBackground
495
- source={{ uri: img }}
493
+ <View style={{ flex: 1 }}>
494
+ {children}
495
+ </View>
496
+ {isDraw && (
497
+ <RNDrawingView
498
+ ref={canvasRef}
496
499
  style={{
497
- alignItems: 'center',
498
- width: "100%",
499
- height: "100%"
500
+ position: 'absolute',
501
+ top: 0,
502
+ left: 0,
503
+ right: 0,
504
+ bottom: 0,
505
+ width: '100%',
506
+ height: '100%',
507
+ zIndex: 999
500
508
  }}
501
- resizeMode='contain'
502
- >
503
- <RNDrawingView
504
- ref={canvasRef}
505
- style={{ width: '100%', height: '100%' }}
506
- color={'red'}
507
- strokeWidth={Platform.OS == 'android' ? 5 : 3}
508
- />
509
-
510
- </ImageBackground>
511
- ) : (<View style={{ flex: 1 }}>
512
- {children}
513
- </View>)}
509
+ color={'red'}
510
+ strokeWidth={Platform.OS == 'android' ? 5 : 3}
511
+ />
512
+ )}
514
513
 
515
514
 
516
515
  </ShakebugCapture>
@@ -555,18 +554,9 @@ const ShakeFunction = ({ children, themeColor, showTutorialScreen, SDKScreenTitl
555
554
 
556
555
  {isDraw == false ? (
557
556
  <TouchableOpacity
558
- onPress={async () => {
559
- StatusBar.setHidden(false, 'slide')
560
- let ImgUrl = null;
561
- try {
562
- ImgUrl = Platform.OS === 'android' ? await captureScreen({ format: 'jpg', quality: 1 }) : (ref.current ? await ref.current.capture() : null);
563
- } catch (e) {
564
- log.error("Failed to capture screenshot in stop recording", e);
565
- }
566
- if (ImgUrl != undefined || ImgUrl != null) {
567
- setImg(ImgUrl)
568
- setIsDraw(true)
569
- }
557
+ onPress={() => {
558
+ setIsDraw(true)
559
+ global.isDraw = true
570
560
  }}
571
561
  hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
572
562
  >
@@ -576,6 +566,7 @@ const ShakeFunction = ({ children, themeColor, showTutorialScreen, SDKScreenTitl
576
566
  <TouchableOpacity
577
567
  onPress={() => {
578
568
  setIsDraw(false)
569
+ global.isDraw = false
579
570
  ClearCanvas(canvasRef)
580
571
  }}
581
572
  hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
@@ -254,7 +254,7 @@ const AddDetailsScreen = ({ media, updateParent, mediaType, themeColor, SDKScree
254
254
  log.debug("------------------------------------------------------------------------------------------")
255
255
  } else {
256
256
  setIsLoading(false)
257
- setAPIMessage(message || "Something went wrong! Please try again later!")
257
+ setAPIMessage("Something went wrong! Please try again later!")
258
258
  setErrorInAPI(true)
259
259
  log.debug("------------------------------------------------------------------------------------------")
260
260
  log.warn('API response:', message);
@@ -262,8 +262,7 @@ const AddDetailsScreen = ({ media, updateParent, mediaType, themeColor, SDKScree
262
262
  }
263
263
  }
264
264
  catch (err) {
265
- const errorMsg = err?.message || err?.toString() || "Something went wrong! Please try again later!"
266
- setAPIMessage(errorMsg)
265
+ setAPIMessage("Something went wrong! Please try again later!")
267
266
  setErrorInAPI(true)
268
267
  setIsLoading(false)
269
268
  log.error("err", err)
@@ -433,7 +432,6 @@ const AddDetailsScreen = ({ media, updateParent, mediaType, themeColor, SDKScree
433
432
  isVisible={isErrorInAPI || isBugReported}
434
433
  text={apiMessage}
435
434
  color={themeColor}
436
- showCopyOption={isErrorInAPI}
437
435
  OnPrees={() => {
438
436
  if (isBugReported) {
439
437
  global.isScreenShotDetected = false;
@@ -53,7 +53,7 @@ global.isScreeenShotTaken = false;
53
53
  global.restrictedViews = [];
54
54
  global.currentScreen = ""
55
55
  global.isShakebugSDKOpen = false;
56
- global.sdk_version = "2.3.7";
56
+ global.sdk_version = "2.3.8";
57
57
  global.app_lunch_count = 0;
58
58
  global.POPUP_LAUNCH_THRESHOLD = 3;
59
59
  global.POPUP_COOLDOWN_DAYS = 2;