shakebug-react-native 2.4.15 → 2.4.17
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/README.md +6 -0
- package/android/src/main/java/com/shakebug/ConnectivityReceiver.java +12 -7
- package/android/src/main/java/com/shakebug/DrawingView.java +13 -3
- package/android/src/main/java/com/shakebug/RecordScreenModule.java +6 -3
- package/android/src/main/java/com/shakebug/ViewShot.java +1 -0
- package/ios/CustomScreenShot/ShakebugSDKCustomScreenCapture.m +6 -2
- package/ios/ScreenShot/ShakebugCapture.m +3 -1
- package/ios/SketchCanvas/DrawingView.m +14 -1
- package/package.json +1 -1
- package/shakebug-react-native-2.4.15.tgz +0 -0
- package/src/Assets/images/shake.png +0 -0
- package/src/Assets/images/undo.png +0 -0
- package/src/Assets/images/undo@2x.png +0 -0
- package/src/Assets/images/undo@3x.png +0 -0
- package/src/Componanats/CustomAlert.js +8 -4
- package/src/Componanats/Icons.js +278 -0
- package/src/Componanats/KeyboardAvoidingWrapper.js +31 -39
- package/src/Componanats/LoadingModal.js +7 -4
- package/src/Componanats/NavigationContext.js +8 -1
- package/src/Componanats/ReviewModal.js +18 -11
- package/src/Componanats/SafeAreaHelper.js +70 -0
- package/src/Componanats/ShakeFunction.js +655 -364
- package/src/Componanats/ShakebugBottomSheet.js +729 -0
- package/src/Componanats/Theme.js +96 -0
- package/src/Componanats/ZoomableImage.js +350 -0
- package/src/Componanats/localization.js +32 -3
- package/src/Screens/AddDetailsScreen.js +800 -439
- package/src/Screens/FirstScreen.js +950 -540
- package/src/Screens/Shakebug.js +78 -44
- package/src/Screens/TrimVideoScreen.js +40 -7
- package/src/index.tsx +16 -7
- package/shakebug-react-native-2.4.14.tgz +0 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { Modal, View, Text, TextInput, TouchableOpacity, StyleSheet, Image, KeyboardAvoidingView, ScrollView, TouchableWithoutFeedback, Keyboard, NativeModules } from 'react-native';
|
|
2
|
+
import { Modal, View, Text, TextInput, TouchableOpacity, StyleSheet, Image, KeyboardAvoidingView, ScrollView, TouchableWithoutFeedback, Keyboard, NativeModules, useColorScheme, Platform } from 'react-native';
|
|
3
3
|
import { AddReviewApi } from '../APIs/AddReview';
|
|
4
|
+
import { isShakebugDark } from './Theme';
|
|
4
5
|
|
|
5
|
-
const ReviewModal = ({ visible, onClose, onSubmit, color }) => {
|
|
6
|
+
const ReviewModal = ({ visible, onClose, onSubmit, color = '#313A46' }) => {
|
|
7
|
+
const colorScheme = useColorScheme();
|
|
8
|
+
const isDark = isShakebugDark(colorScheme);
|
|
6
9
|
|
|
7
10
|
const { ShakebugSDKSharedPreferencesModule } = NativeModules;
|
|
8
11
|
|
|
@@ -32,9 +35,9 @@ const ReviewModal = ({ visible, onClose, onSubmit, color }) => {
|
|
|
32
35
|
keyboardShouldPersistTaps="handled"
|
|
33
36
|
bounces={false}
|
|
34
37
|
>
|
|
35
|
-
<View style={styles.modalContainer}>
|
|
36
|
-
<Text style={styles.title}>Rate Your Experience</Text>
|
|
37
|
-
<Text style={styles.subtitle}>We value your feedback</Text>
|
|
38
|
+
<View style={[styles.modalContainer, { backgroundColor: isDark ? '#2b2f38' : '#fff' }]}>
|
|
39
|
+
<Text style={[styles.title, { color: isDark ? '#fff' : '#333' }]}>Rate Your Experience</Text>
|
|
40
|
+
<Text style={[styles.subtitle, { color: isDark ? '#8e9db0' : '#777' }]}>We value your feedback</Text>
|
|
38
41
|
|
|
39
42
|
<View style={styles.starsContainer}>
|
|
40
43
|
{[1, 2, 3, 4, 5].map((star) => (
|
|
@@ -45,7 +48,7 @@ const ReviewModal = ({ visible, onClose, onSubmit, color }) => {
|
|
|
45
48
|
? require("../Assets/images/solar_star-bold.png")
|
|
46
49
|
: require("../Assets/images/solar_star-line-duotone.png")
|
|
47
50
|
}
|
|
48
|
-
tintColor={color}
|
|
51
|
+
tintColor={isDark ? '#eab308' : (color || '#313A46')}
|
|
49
52
|
style={styles.star}
|
|
50
53
|
/>
|
|
51
54
|
</TouchableOpacity>
|
|
@@ -54,24 +57,28 @@ const ReviewModal = ({ visible, onClose, onSubmit, color }) => {
|
|
|
54
57
|
|
|
55
58
|
<TextInput
|
|
56
59
|
placeholder="Write your review(optioanl)..."
|
|
57
|
-
placeholderTextColor=
|
|
60
|
+
placeholderTextColor={isDark ? '#8e9db0' : '#999'}
|
|
58
61
|
value={feedback}
|
|
59
62
|
onChangeText={setFeedback}
|
|
60
63
|
multiline
|
|
61
|
-
style={styles.textInput
|
|
64
|
+
style={[styles.textInput, {
|
|
65
|
+
borderColor: isDark ? '#363b46' : '#ccc',
|
|
66
|
+
color: isDark ? '#fff' : '#000',
|
|
67
|
+
backgroundColor: isDark ? '#21252c' : '#fff'
|
|
68
|
+
}]}
|
|
62
69
|
/>
|
|
63
70
|
|
|
64
71
|
<View style={styles.buttons}>
|
|
65
72
|
<TouchableOpacity
|
|
66
|
-
style={styles.cancelButton}
|
|
73
|
+
style={[styles.cancelButton, { borderColor: isDark ? '#444955' : '#ccc' }]}
|
|
67
74
|
onPress={() => {
|
|
68
75
|
ShakebugSDKSharedPreferencesModule.setString("LAST_POPUP_TIME", Date.now()?.toString())
|
|
69
76
|
onClose()
|
|
70
77
|
}}
|
|
71
78
|
>
|
|
72
|
-
<Text style={styles.cancelText}>Cancel</Text>
|
|
79
|
+
<Text style={[styles.cancelText, { color: isDark ? '#cbd5e1' : '#666' }]}>Cancel</Text>
|
|
73
80
|
</TouchableOpacity>
|
|
74
|
-
<TouchableOpacity style={[styles.submitButton, { backgroundColor: color }]} onPress={handleSubmit}>
|
|
81
|
+
<TouchableOpacity style={[styles.submitButton, { backgroundColor: color || '#313A46' }]} onPress={handleSubmit}>
|
|
75
82
|
<Text style={styles.submitText}>Submit</Text>
|
|
76
83
|
</TouchableOpacity>
|
|
77
84
|
</View>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Platform, Dimensions, StatusBar } from 'react-native';
|
|
2
|
+
import DeviceInfo from '../../DeviceInfo';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Checks if the current iOS device has a notch or Dynamic Island (home indicator at bottom).
|
|
6
|
+
*/
|
|
7
|
+
export const isIPhoneWithNotch = () => {
|
|
8
|
+
if (Platform.OS !== 'ios') return false;
|
|
9
|
+
try {
|
|
10
|
+
if (typeof DeviceInfo.hasNotch === 'function' && DeviceInfo.hasNotch()) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
if (typeof DeviceInfo.hasDynamicIsland === 'function' && DeviceInfo.hasDynamicIsland()) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
} catch (e) {}
|
|
17
|
+
|
|
18
|
+
const windowDim = Dimensions.get('window');
|
|
19
|
+
const screenDim = Dimensions.get('screen');
|
|
20
|
+
const maxDim = Math.max(
|
|
21
|
+
windowDim?.width || 0,
|
|
22
|
+
windowDim?.height || 0,
|
|
23
|
+
screenDim?.width || 0,
|
|
24
|
+
screenDim?.height || 0
|
|
25
|
+
);
|
|
26
|
+
// iPhone X, XR, XS, 11, 12, 13, 14, 15, 16 all have screen dimension >= 780
|
|
27
|
+
return maxDim >= 780 || maxDim === 0;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Returns safe bottom inset space in points:
|
|
32
|
+
* - 34pt on notched / Dynamic Island iPhones (for home indicator)
|
|
33
|
+
* - 0pt on home-button iPhones (iPhone SE, 8, etc.)
|
|
34
|
+
* - 56dp on Android (clears 3-button navigation bar and gesture navigation)
|
|
35
|
+
*/
|
|
36
|
+
export const getBottomSpace = () => {
|
|
37
|
+
if (Platform.OS === 'ios') {
|
|
38
|
+
return isIPhoneWithNotch() ? 34 : 0;
|
|
39
|
+
}
|
|
40
|
+
return 56;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Returns safe top inset space in points:
|
|
45
|
+
* - StatusBar.currentHeight on Android
|
|
46
|
+
* - 54pt on Dynamic Island iPhones (14 Pro, 15, 16 series)
|
|
47
|
+
* - 44pt on notched iPhones (X through 14)
|
|
48
|
+
* - 20pt on standard iPhones
|
|
49
|
+
*/
|
|
50
|
+
export const getTopSpace = () => {
|
|
51
|
+
if (Platform.OS === 'android') {
|
|
52
|
+
return Math.max(StatusBar.currentHeight || 0, 24);
|
|
53
|
+
}
|
|
54
|
+
if (!isIPhoneWithNotch()) {
|
|
55
|
+
return 20;
|
|
56
|
+
}
|
|
57
|
+
const windowDim = Dimensions.get('window');
|
|
58
|
+
const screenDim = Dimensions.get('screen');
|
|
59
|
+
const maxDim = Math.max(
|
|
60
|
+
windowDim?.width || 0,
|
|
61
|
+
windowDim?.height || 0,
|
|
62
|
+
screenDim?.width || 0,
|
|
63
|
+
screenDim?.height || 0
|
|
64
|
+
);
|
|
65
|
+
// Dynamic Island iPhones (14 Pro, 15, 16 series) have height >= 852
|
|
66
|
+
if (maxDim >= 852 || maxDim === 0) {
|
|
67
|
+
return 54;
|
|
68
|
+
}
|
|
69
|
+
return 44;
|
|
70
|
+
};
|