react-native-in-app-debugger 1.0.38 → 1.0.40
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/Api.jsx +1 -14
- package/index.jsx +3 -2
- package/package.json +1 -1
- package/useAnimation.ts +3 -1
package/Api.jsx
CHANGED
|
@@ -97,7 +97,6 @@ const isError = (a) => a.response?.status < 200 || a.response?.status >= 400;
|
|
|
97
97
|
export default (props) => {
|
|
98
98
|
const [filter, setFilter] = useState("");
|
|
99
99
|
const [errorOnly, setErrorOnly] = useState(false);
|
|
100
|
-
const [filterUrlOnly, setFilterUrlOnly] = useState(true);
|
|
101
100
|
const [expands, setExpands] = useState({});
|
|
102
101
|
const apis = props.apis.filter((a) => !errorOnly || isError(a));
|
|
103
102
|
|
|
@@ -154,16 +153,6 @@ export default (props) => {
|
|
|
154
153
|
onChangeText={(t) => setFilter(t.toLowerCase())}
|
|
155
154
|
/>
|
|
156
155
|
</View>
|
|
157
|
-
{!!filter && (
|
|
158
|
-
<TouchableOpacity
|
|
159
|
-
style={{ padding: 5 }}
|
|
160
|
-
onPress={() => setFilterUrlOnly((v) => !v)}
|
|
161
|
-
>
|
|
162
|
-
<Text style={{ color: "#ffffff88" }}>
|
|
163
|
-
{filterUrlOnly ? "by URL" : "by URL & body"}
|
|
164
|
-
</Text>
|
|
165
|
-
</TouchableOpacity>
|
|
166
|
-
)}
|
|
167
156
|
</View>
|
|
168
157
|
{!filter &&
|
|
169
158
|
!!props.maxNumOfApiToStore &&
|
|
@@ -179,9 +168,7 @@ export default (props) => {
|
|
|
179
168
|
showsVerticalScrollIndicator
|
|
180
169
|
sections={apis
|
|
181
170
|
.filter((a) =>
|
|
182
|
-
!filter ||
|
|
183
|
-
? a.request.url.includes(filter)
|
|
184
|
-
: JSON.stringify(a).toLowerCase().includes(filter)
|
|
171
|
+
!filter || JSON.stringify(a).toLowerCase().includes(filter)
|
|
185
172
|
)
|
|
186
173
|
.map((data) => ({ data: [data], id: data.id }))}
|
|
187
174
|
renderItem={(i) =>
|
package/index.jsx
CHANGED
|
@@ -78,6 +78,7 @@ export default ({
|
|
|
78
78
|
isOpen,
|
|
79
79
|
panResponder,
|
|
80
80
|
setIsOpen,
|
|
81
|
+
shouldShowDetails,
|
|
81
82
|
} = useAnimation(badgeHeight);
|
|
82
83
|
return (
|
|
83
84
|
<Animated.View
|
|
@@ -85,14 +86,14 @@ export default ({
|
|
|
85
86
|
transform: [{ translateX }, { translateY }],
|
|
86
87
|
position: "absolute",
|
|
87
88
|
borderRadius,
|
|
88
|
-
backgroundColor: "#000000" + (isOpen ? "
|
|
89
|
+
backgroundColor: "#000000" + (isOpen ? "ee" : "bb"),
|
|
89
90
|
height,
|
|
90
91
|
width,
|
|
91
92
|
borderTopRightRadius: numPendingApiCalls || errors ? 0 : undefined,
|
|
92
93
|
}}
|
|
93
94
|
{...(isOpen ? {} : panResponder.panHandlers)}
|
|
94
95
|
>
|
|
95
|
-
{!
|
|
96
|
+
{!shouldShowDetails ? (
|
|
96
97
|
<TouchableOpacity
|
|
97
98
|
onPress={() => setIsOpen(true)}
|
|
98
99
|
style={styles.box}
|
package/package.json
CHANGED
package/useAnimation.ts
CHANGED
|
@@ -14,6 +14,7 @@ export default (defaultBadgeHeight) => {
|
|
|
14
14
|
const badgeWidth = useRef(new Animated.Value(defaultBadgeWidth)).current;
|
|
15
15
|
const { width, height } = useWindowDimensions();
|
|
16
16
|
const [isOpen, setIsOpen] = useState(false);
|
|
17
|
+
const [shouldShowDetails, setShouldShowDetails] = useState(false);
|
|
17
18
|
|
|
18
19
|
useEffect(() => {
|
|
19
20
|
const showSubscription = Keyboard.addListener('keyboardDidShow', () => {
|
|
@@ -29,7 +30,6 @@ export default (defaultBadgeHeight) => {
|
|
|
29
30
|
};
|
|
30
31
|
}, [isOpen]);
|
|
31
32
|
|
|
32
|
-
|
|
33
33
|
const panResponder = useRef(
|
|
34
34
|
PanResponder.create({
|
|
35
35
|
onStartShouldSetPanResponder: () => false,
|
|
@@ -57,6 +57,7 @@ export default (defaultBadgeHeight) => {
|
|
|
57
57
|
}, [defaultBadgeHeight]);
|
|
58
58
|
|
|
59
59
|
useEffect(() => {
|
|
60
|
+
setTimeout(() => setShouldShowDetails(isOpen), isOpen ? 200 : 0);
|
|
60
61
|
Animated.spring(position, { toValue: isOpen ? { x: 0, y: 0 } : cachePosition.current, ...und }).start();
|
|
61
62
|
Animated.spring(borderRadius, { toValue: isOpen ? 0 : defaultBorderRadius, ...und }).start();
|
|
62
63
|
Animated.spring(badgeHeight, { toValue: isOpen ? height : defaultBadgeHeight, ...und }).start();
|
|
@@ -72,5 +73,6 @@ export default (defaultBadgeHeight) => {
|
|
|
72
73
|
isOpen,
|
|
73
74
|
setIsOpen,
|
|
74
75
|
borderRadius,
|
|
76
|
+
shouldShowDetails,
|
|
75
77
|
};
|
|
76
78
|
};
|