react-native-inapp-inspector 1.0.0
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/LICENSE +21 -0
- package/README.md +97 -0
- package/dist/commonjs/components/AnalyticsDetail.d.ts +6 -0
- package/dist/commonjs/components/AnalyticsDetail.js +558 -0
- package/dist/commonjs/components/AnalyticsEventCard.d.ts +18 -0
- package/dist/commonjs/components/AnalyticsEventCard.js +327 -0
- package/dist/commonjs/components/AnalyticsGraph.d.ts +8 -0
- package/dist/commonjs/components/AnalyticsGraph.js +416 -0
- package/dist/commonjs/components/CodeSnippet.d.ts +8 -0
- package/dist/commonjs/components/CodeSnippet.js +427 -0
- package/dist/commonjs/components/ConsoleLogCard.d.ts +10 -0
- package/dist/commonjs/components/ConsoleLogCard.js +401 -0
- package/dist/commonjs/components/CopyButton.d.ts +4 -0
- package/dist/commonjs/components/CopyButton.js +69 -0
- package/dist/commonjs/components/DiffViewer.d.ts +7 -0
- package/dist/commonjs/components/DiffViewer.js +86 -0
- package/dist/commonjs/components/DomainHeader.d.ts +18 -0
- package/dist/commonjs/components/DomainHeader.js +136 -0
- package/dist/commonjs/components/EmptyState.d.ts +5 -0
- package/dist/commonjs/components/EmptyState.js +40 -0
- package/dist/commonjs/components/HeadersSection.d.ts +4 -0
- package/dist/commonjs/components/HeadersSection.js +155 -0
- package/dist/commonjs/components/HighlightText.d.ts +3 -0
- package/dist/commonjs/components/HighlightText.js +57 -0
- package/dist/commonjs/components/JsonViewer.d.ts +7 -0
- package/dist/commonjs/components/JsonViewer.js +19 -0
- package/dist/commonjs/components/LogCard.d.ts +4 -0
- package/dist/commonjs/components/LogCard.js +179 -0
- package/dist/commonjs/components/MetaAccordion.d.ts +4 -0
- package/dist/commonjs/components/MetaAccordion.js +113 -0
- package/dist/commonjs/components/MiniBarChart.d.ts +7 -0
- package/dist/commonjs/components/MiniBarChart.js +56 -0
- package/dist/commonjs/components/MiniLineChart.d.ts +6 -0
- package/dist/commonjs/components/MiniLineChart.js +58 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +31 -0
- package/dist/commonjs/components/NetworkIcons.js +245 -0
- package/dist/commonjs/components/SectionHeader.d.ts +4 -0
- package/dist/commonjs/components/SectionHeader.js +87 -0
- package/dist/commonjs/components/SourcePageCard.d.ts +4 -0
- package/dist/commonjs/components/SourcePageCard.js +132 -0
- package/dist/commonjs/components/TouchableScale.d.ts +9 -0
- package/dist/commonjs/components/TouchableScale.js +44 -0
- package/dist/commonjs/components/TreeNode.d.ts +4 -0
- package/dist/commonjs/components/TreeNode.js +140 -0
- package/dist/commonjs/constants/index.d.ts +7 -0
- package/dist/commonjs/constants/index.js +35 -0
- package/dist/commonjs/customHooks/analyticsLogger.d.ts +21 -0
- package/dist/commonjs/customHooks/analyticsLogger.js +160 -0
- package/dist/commonjs/customHooks/consoleLogger.d.ts +5 -0
- package/dist/commonjs/customHooks/consoleLogger.js +141 -0
- package/dist/commonjs/customHooks/logFilters.d.ts +5 -0
- package/dist/commonjs/customHooks/logFilters.js +34 -0
- package/dist/commonjs/customHooks/networkLogger.d.ts +20 -0
- package/dist/commonjs/customHooks/networkLogger.js +272 -0
- package/dist/commonjs/customHooks/useAccordion.d.ts +17 -0
- package/dist/commonjs/customHooks/useAccordion.js +48 -0
- package/dist/commonjs/customHooks/webViewLogger.d.ts +22 -0
- package/dist/commonjs/customHooks/webViewLogger.js +412 -0
- package/dist/commonjs/helpers/index.d.ts +20 -0
- package/dist/commonjs/helpers/index.js +229 -0
- package/dist/commonjs/index.d.ts +7 -0
- package/dist/commonjs/index.js +2668 -0
- package/dist/commonjs/styles/AppColors.d.ts +27 -0
- package/dist/commonjs/styles/AppColors.js +30 -0
- package/dist/commonjs/styles/AppFonts.d.ts +7 -0
- package/dist/commonjs/styles/AppFonts.js +10 -0
- package/dist/commonjs/styles/index.d.ts +1488 -0
- package/dist/commonjs/styles/index.js +1357 -0
- package/dist/commonjs/types/index.d.ts +127 -0
- package/dist/commonjs/types/index.js +2 -0
- package/dist/esm/components/AnalyticsDetail.d.ts +6 -0
- package/dist/esm/components/AnalyticsDetail.js +520 -0
- package/dist/esm/components/AnalyticsEventCard.d.ts +18 -0
- package/dist/esm/components/AnalyticsEventCard.js +288 -0
- package/dist/esm/components/AnalyticsGraph.d.ts +8 -0
- package/dist/esm/components/AnalyticsGraph.js +378 -0
- package/dist/esm/components/CodeSnippet.d.ts +8 -0
- package/dist/esm/components/CodeSnippet.js +392 -0
- package/dist/esm/components/ConsoleLogCard.d.ts +10 -0
- package/dist/esm/components/ConsoleLogCard.js +362 -0
- package/dist/esm/components/CopyButton.d.ts +4 -0
- package/dist/esm/components/CopyButton.js +31 -0
- package/dist/esm/components/DiffViewer.d.ts +7 -0
- package/dist/esm/components/DiffViewer.js +48 -0
- package/dist/esm/components/DomainHeader.d.ts +18 -0
- package/dist/esm/components/DomainHeader.js +98 -0
- package/dist/esm/components/EmptyState.d.ts +5 -0
- package/dist/esm/components/EmptyState.js +35 -0
- package/dist/esm/components/HeadersSection.d.ts +4 -0
- package/dist/esm/components/HeadersSection.js +117 -0
- package/dist/esm/components/HighlightText.d.ts +3 -0
- package/dist/esm/components/HighlightText.js +52 -0
- package/dist/esm/components/JsonViewer.d.ts +7 -0
- package/dist/esm/components/JsonViewer.js +14 -0
- package/dist/esm/components/LogCard.d.ts +4 -0
- package/dist/esm/components/LogCard.js +141 -0
- package/dist/esm/components/MetaAccordion.d.ts +4 -0
- package/dist/esm/components/MetaAccordion.js +108 -0
- package/dist/esm/components/MiniBarChart.d.ts +7 -0
- package/dist/esm/components/MiniBarChart.js +18 -0
- package/dist/esm/components/MiniLineChart.d.ts +6 -0
- package/dist/esm/components/MiniLineChart.js +20 -0
- package/dist/esm/components/NetworkIcons.d.ts +31 -0
- package/dist/esm/components/NetworkIcons.js +176 -0
- package/dist/esm/components/SectionHeader.d.ts +4 -0
- package/dist/esm/components/SectionHeader.js +49 -0
- package/dist/esm/components/SourcePageCard.d.ts +4 -0
- package/dist/esm/components/SourcePageCard.js +94 -0
- package/dist/esm/components/TouchableScale.d.ts +9 -0
- package/dist/esm/components/TouchableScale.js +9 -0
- package/dist/esm/components/TreeNode.d.ts +4 -0
- package/dist/esm/components/TreeNode.js +102 -0
- package/dist/esm/constants/index.d.ts +7 -0
- package/dist/esm/constants/index.js +32 -0
- package/dist/esm/customHooks/analyticsLogger.d.ts +21 -0
- package/dist/esm/customHooks/analyticsLogger.js +152 -0
- package/dist/esm/customHooks/consoleLogger.d.ts +5 -0
- package/dist/esm/customHooks/consoleLogger.js +134 -0
- package/dist/esm/customHooks/logFilters.d.ts +5 -0
- package/dist/esm/customHooks/logFilters.js +31 -0
- package/dist/esm/customHooks/networkLogger.d.ts +20 -0
- package/dist/esm/customHooks/networkLogger.js +264 -0
- package/dist/esm/customHooks/useAccordion.d.ts +17 -0
- package/dist/esm/customHooks/useAccordion.js +46 -0
- package/dist/esm/customHooks/webViewLogger.d.ts +22 -0
- package/dist/esm/customHooks/webViewLogger.js +365 -0
- package/dist/esm/helpers/index.d.ts +20 -0
- package/dist/esm/helpers/index.js +207 -0
- package/dist/esm/index.d.ts +7 -0
- package/dist/esm/index.js +2611 -0
- package/dist/esm/styles/AppColors.d.ts +27 -0
- package/dist/esm/styles/AppColors.js +27 -0
- package/dist/esm/styles/AppFonts.d.ts +7 -0
- package/dist/esm/styles/AppFonts.js +7 -0
- package/dist/esm/styles/index.d.ts +1488 -0
- package/dist/esm/styles/index.js +1355 -0
- package/dist/esm/types/index.d.ts +127 -0
- package/dist/esm/types/index.js +1 -0
- package/fonts/Inter/Inter.ttc +0 -0
- package/fonts/Inter/InterVariable-Italic.ttf +0 -0
- package/fonts/Inter/InterVariable.ttf +0 -0
- package/fonts/Inter/LICENSE.txt +92 -0
- package/fonts/Inter/extras/otf/Inter-Black.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-BlackItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Bold.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-BoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-ExtraBold.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-ExtraBoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-ExtraLight.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-ExtraLightItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Italic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Light.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-LightItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Medium.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-MediumItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Regular.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-SemiBold.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-SemiBoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Thin.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-ThinItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Black.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-BlackItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Bold.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-BoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-ExtraBold.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-ExtraBoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-ExtraLight.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-ExtraLightItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Italic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Light.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-LightItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Medium.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-MediumItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Regular.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-SemiBold.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-SemiBoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Thin.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-ThinItalic.otf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Black.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-BlackItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Bold.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-BoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-ExtraBold.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-ExtraBoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-ExtraLight.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-ExtraLightItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Italic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Light.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-LightItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Medium.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-MediumItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Regular.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-SemiBold.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-SemiBoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Thin.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-ThinItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Black.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-BlackItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Bold.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-BoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-ExtraBold.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-ExtraBoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-ExtraLight.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-ExtraLightItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Italic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Light.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-LightItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Medium.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-MediumItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Regular.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-SemiBold.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-SemiBoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Thin.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-ThinItalic.ttf +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Black.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-BlackItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Bold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-BoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-ExtraBold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-ExtraBoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-ExtraLight.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-ExtraLightItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Italic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Light.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-LightItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Medium.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-MediumItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Regular.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-SemiBold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-SemiBoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Thin.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-ThinItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Black.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-BlackItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Bold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-BoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-ExtraBold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-ExtraBoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-ExtraLight.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-ExtraLightItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Italic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Light.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-LightItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Medium.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-MediumItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Regular.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-SemiBold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-SemiBoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Thin.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-ThinItalic.woff2 +0 -0
- package/fonts/Inter/help.txt +165 -0
- package/fonts/Inter/web/Inter-Black.woff2 +0 -0
- package/fonts/Inter/web/Inter-BlackItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Bold.woff2 +0 -0
- package/fonts/Inter/web/Inter-BoldItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-ExtraBold.woff2 +0 -0
- package/fonts/Inter/web/Inter-ExtraBoldItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-ExtraLight.woff2 +0 -0
- package/fonts/Inter/web/Inter-ExtraLightItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Italic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Light.woff2 +0 -0
- package/fonts/Inter/web/Inter-LightItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Medium.woff2 +0 -0
- package/fonts/Inter/web/Inter-MediumItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Regular.woff2 +0 -0
- package/fonts/Inter/web/Inter-SemiBold.woff2 +0 -0
- package/fonts/Inter/web/Inter-SemiBoldItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Thin.woff2 +0 -0
- package/fonts/Inter/web/Inter-ThinItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Black.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-BlackItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Bold.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-BoldItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-ExtraBold.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-ExtraBoldItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-ExtraLight.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-ExtraLightItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Italic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Light.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-LightItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Medium.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-MediumItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Regular.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-SemiBold.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-SemiBoldItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Thin.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-ThinItalic.woff2 +0 -0
- package/fonts/Inter/web/InterVariable-Italic.woff2 +0 -0
- package/fonts/Inter/web/InterVariable.woff2 +0 -0
- package/fonts/Inter/web/inter.css +148 -0
- package/package.json +52 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { View, Pressable, Text, Animated } from 'react-native';
|
|
3
|
+
// Components
|
|
4
|
+
import CopyButton from './CopyButton';
|
|
5
|
+
import TouchableScale from './TouchableScale';
|
|
6
|
+
// Helpers
|
|
7
|
+
import { copyToClipboard } from '../helpers';
|
|
8
|
+
// Custom Hooks
|
|
9
|
+
import useAccordion from '../customHooks/useAccordion';
|
|
10
|
+
// Assets
|
|
11
|
+
import { HeadersIcon, ChevronIcon, CopyIcon } from './NetworkIcons';
|
|
12
|
+
// Stylesheet
|
|
13
|
+
import { AppColors } from '../styles/AppColors';
|
|
14
|
+
import styles from '../styles';
|
|
15
|
+
const HeaderRow = React.memo(function HeaderRow({ headerKey, value, isLast, index, }) {
|
|
16
|
+
const [expanded, setExpanded] = useState(false);
|
|
17
|
+
const isLong = value.length > 35;
|
|
18
|
+
const entryAnim = useRef(new Animated.Value(0)).current;
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
Animated.timing(entryAnim, {
|
|
21
|
+
toValue: 1,
|
|
22
|
+
duration: 220,
|
|
23
|
+
delay: index * 30,
|
|
24
|
+
useNativeDriver: true,
|
|
25
|
+
}).start();
|
|
26
|
+
}, []);
|
|
27
|
+
const rowAnimStyle = {
|
|
28
|
+
opacity: entryAnim,
|
|
29
|
+
transform: [
|
|
30
|
+
{
|
|
31
|
+
translateY: entryAnim.interpolate({
|
|
32
|
+
inputRange: [0, 1],
|
|
33
|
+
outputRange: [8, 0],
|
|
34
|
+
}),
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
return (<Animated.View style={[styles.htRow, !isLast && styles.htRowBorder, rowAnimStyle]}>
|
|
39
|
+
<View style={styles.htKeyCell}>
|
|
40
|
+
<Text style={styles.htKey} numberOfLines={2}>
|
|
41
|
+
{headerKey}
|
|
42
|
+
</Text>
|
|
43
|
+
</View>
|
|
44
|
+
<View style={styles.htCellDivider}/>
|
|
45
|
+
<Pressable style={styles.htValueCell} onPress={() => isLong && setExpanded(v => !v)} hitSlop={8}>
|
|
46
|
+
<Text style={styles.htValue} selectable numberOfLines={expanded ? undefined : 3}>
|
|
47
|
+
{value}
|
|
48
|
+
</Text>
|
|
49
|
+
{isLong && (<View style={styles.htExpandRow}>
|
|
50
|
+
<Text style={styles.htExpandText}>
|
|
51
|
+
{expanded ? '▲ less' : '▼ more'}
|
|
52
|
+
</Text>
|
|
53
|
+
</View>)}
|
|
54
|
+
</Pressable>
|
|
55
|
+
<TouchableScale onPress={() => copyToClipboard(value, headerKey)} hitSlop={8} style={styles.htCopyBtn}>
|
|
56
|
+
<CopyIcon color={AppColors.grayTextWeak} size={14}/>
|
|
57
|
+
</TouchableScale>
|
|
58
|
+
</Animated.View>);
|
|
59
|
+
});
|
|
60
|
+
const HeadersSection = ({ title, headers, search, resetKey, }) => {
|
|
61
|
+
const { toggleOpen, forceOpen, chevronStyle, bodyStyle } = useAccordion(false, 2400, 300);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
forceOpen(false);
|
|
64
|
+
}, [resetKey]);
|
|
65
|
+
const entries = useMemo(() => (headers ? Object.entries(headers) : []), [headers]);
|
|
66
|
+
const filtered = useMemo(() => {
|
|
67
|
+
if (!search)
|
|
68
|
+
return entries;
|
|
69
|
+
const q = search.toLowerCase();
|
|
70
|
+
return entries.filter(([k, v]) => k.toLowerCase().includes(q) || v.toLowerCase().includes(q));
|
|
71
|
+
}, [entries, search]);
|
|
72
|
+
if (entries.length === 0)
|
|
73
|
+
return null;
|
|
74
|
+
const isRequest = title.toLowerCase().includes('request') ||
|
|
75
|
+
title.toLowerCase().includes('api');
|
|
76
|
+
const accentColor = isRequest ? AppColors.offerPurple : AppColors.greenColor;
|
|
77
|
+
const accentBg = isRequest
|
|
78
|
+
? `${AppColors.offerPurple}10`
|
|
79
|
+
: `${AppColors.greenColor}10`;
|
|
80
|
+
return (<View style={[styles.htCard, { borderLeftColor: accentColor }]}>
|
|
81
|
+
<Pressable onPress={toggleOpen} hitSlop={10}>
|
|
82
|
+
<View style={styles.htCardHeader}>
|
|
83
|
+
<View style={[styles.htIconWrap, { backgroundColor: accentBg }]}>
|
|
84
|
+
<HeadersIcon color={accentColor}/>
|
|
85
|
+
</View>
|
|
86
|
+
<Text style={styles.htTitle}>{title}</Text>
|
|
87
|
+
<View style={[
|
|
88
|
+
styles.htBadge,
|
|
89
|
+
{ backgroundColor: accentBg, borderColor: accentColor },
|
|
90
|
+
]}>
|
|
91
|
+
<Text style={[styles.htBadgeText, { color: accentColor }]}>
|
|
92
|
+
{entries.length}
|
|
93
|
+
</Text>
|
|
94
|
+
</View>
|
|
95
|
+
<View style={styles.htHeaderSpacer}/>
|
|
96
|
+
<CopyButton value={headers} label={title}/>
|
|
97
|
+
<View style={styles.htChevronBtn}>
|
|
98
|
+
<Animated.View style={chevronStyle}>
|
|
99
|
+
<ChevronIcon color={AppColors.grayTextStrong} size={14}/>
|
|
100
|
+
</Animated.View>
|
|
101
|
+
</View>
|
|
102
|
+
</View>
|
|
103
|
+
</Pressable>
|
|
104
|
+
|
|
105
|
+
<Animated.View style={bodyStyle}>
|
|
106
|
+
<View style={styles.htColHeadRow}>
|
|
107
|
+
<Text style={[styles.htColHead, { width: '30%' }]}>KEY</Text>
|
|
108
|
+
<Text style={[styles.htColHead, { flex: 1 }]}>VALUE</Text>
|
|
109
|
+
</View>
|
|
110
|
+
|
|
111
|
+
{filtered.length > 0 ? (filtered.map(([k, v], i) => (<HeaderRow key={k} headerKey={k} value={v} isLast={i === filtered.length - 1} index={i}/>))) : (<View style={styles.htEmpty}>
|
|
112
|
+
<Text style={styles.htEmptyText}>No matching headers</Text>
|
|
113
|
+
</View>)}
|
|
114
|
+
</Animated.View>
|
|
115
|
+
</View>);
|
|
116
|
+
};
|
|
117
|
+
export default HeadersSection;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text, Linking } from 'react-native';
|
|
3
|
+
// Helpers
|
|
4
|
+
import { escapeRegex } from '../helpers';
|
|
5
|
+
const HighlightText = ({ text, search, style, highlightStyle, detectLinks, ...rest }) => {
|
|
6
|
+
const hasNumberOfLines = 'numberOfLines' in rest;
|
|
7
|
+
const numLines = hasNumberOfLines ? rest.numberOfLines : 1;
|
|
8
|
+
// Regex to detect absolute URLs
|
|
9
|
+
const URL_REGEX = /(https?:\/\/[^\s]+)/g;
|
|
10
|
+
const renderNormalOrHighlighted = (subText, keyPrefix) => {
|
|
11
|
+
if (!search) {
|
|
12
|
+
return <Text key={keyPrefix}>{subText}</Text>;
|
|
13
|
+
}
|
|
14
|
+
const regex = new RegExp(`(${escapeRegex(search)})`, 'gi');
|
|
15
|
+
const parts = subText.split(regex);
|
|
16
|
+
return (<Text key={keyPrefix}>
|
|
17
|
+
{parts.map((part, i) => part.toLowerCase() === search.toLowerCase() ? (<Text key={i} style={highlightStyle}>
|
|
18
|
+
{part}
|
|
19
|
+
</Text>) : (<Text key={i}>{part}</Text>))}
|
|
20
|
+
</Text>);
|
|
21
|
+
};
|
|
22
|
+
if (detectLinks && text) {
|
|
23
|
+
const parts = text.split(URL_REGEX);
|
|
24
|
+
return (<Text style={style} numberOfLines={numLines} {...rest}>
|
|
25
|
+
{parts.map((part, i) => {
|
|
26
|
+
if (part.match(URL_REGEX)) {
|
|
27
|
+
return (<Text key={`link-${i}`} style={{
|
|
28
|
+
color: '#007AFF', // skyBlue link color
|
|
29
|
+
textDecorationLine: 'underline',
|
|
30
|
+
}} onPress={() => {
|
|
31
|
+
Linking.openURL(part).catch(() => { });
|
|
32
|
+
}}>
|
|
33
|
+
{part}
|
|
34
|
+
</Text>);
|
|
35
|
+
}
|
|
36
|
+
return renderNormalOrHighlighted(part, `text-${i}`);
|
|
37
|
+
})}
|
|
38
|
+
</Text>);
|
|
39
|
+
}
|
|
40
|
+
if (!search)
|
|
41
|
+
return (<Text style={style} numberOfLines={numLines} {...rest}>
|
|
42
|
+
{text}
|
|
43
|
+
</Text>);
|
|
44
|
+
const regex = new RegExp(`(${escapeRegex(search)})`, 'gi');
|
|
45
|
+
const parts = text.split(regex);
|
|
46
|
+
return (<Text style={style} numberOfLines={numLines} {...rest}>
|
|
47
|
+
{parts.map((part, i) => part.toLowerCase() === search.toLowerCase() ? (<Text key={i} style={highlightStyle}>
|
|
48
|
+
{part}
|
|
49
|
+
</Text>) : (<Text key={i}>{part}</Text>))}
|
|
50
|
+
</Text>);
|
|
51
|
+
};
|
|
52
|
+
export default HighlightText;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ScrollView, View } from 'react-native';
|
|
3
|
+
// Components
|
|
4
|
+
import TreeNode from './TreeNode';
|
|
5
|
+
// Stylesheet
|
|
6
|
+
import styles from '../styles';
|
|
7
|
+
const JsonViewer = ({ data, search, forceOpen, }) => {
|
|
8
|
+
return (<ScrollView horizontal showsHorizontalScrollIndicator={true} style={styles.codeBlockScroll}>
|
|
9
|
+
<View style={styles.codeBlock}>
|
|
10
|
+
<TreeNode data={data} search={search} forceOpen={forceOpen}/>
|
|
11
|
+
</View>
|
|
12
|
+
</ScrollView>);
|
|
13
|
+
};
|
|
14
|
+
export default JsonViewer;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { Animated, View, Pressable, Text, StyleSheet } from 'react-native';
|
|
3
|
+
import Svg, { Path } from 'react-native-svg';
|
|
4
|
+
import { AppColors } from '../styles/AppColors';
|
|
5
|
+
import { METHOD_COLORS } from '../constants';
|
|
6
|
+
import { getStatusColor, getDurationColor, getPath, formatDateTime, } from '../helpers';
|
|
7
|
+
import { CalendarIcon, ClockIcon } from './NetworkIcons';
|
|
8
|
+
import styles from '../styles';
|
|
9
|
+
import HighlightText from './HighlightText';
|
|
10
|
+
import TouchableScale from './TouchableScale';
|
|
11
|
+
const LogCard = React.memo(function LogCard({ item, onPress, timelineMinStart, timelineTotalRange, isNew, isSelected, onToggleSelect, searchStr, }) {
|
|
12
|
+
const methodColor = METHOD_COLORS[item.method] ?? METHOD_COLORS.ALL;
|
|
13
|
+
const isFailed = item.status === 0 || (item.status != null && item.status >= 400);
|
|
14
|
+
const isLoading = item.status == null;
|
|
15
|
+
const statusColor = getStatusColor(item.status);
|
|
16
|
+
const durationColor = getDurationColor(item.duration);
|
|
17
|
+
const cardStatusColor = isLoading
|
|
18
|
+
? AppColors.darkOrange
|
|
19
|
+
: isFailed
|
|
20
|
+
? AppColors.errorColor
|
|
21
|
+
: AppColors.greenColor;
|
|
22
|
+
const leftPercent = timelineTotalRange > 0
|
|
23
|
+
? ((item.startTime - timelineMinStart) / timelineTotalRange) * 100
|
|
24
|
+
: 0;
|
|
25
|
+
const widthPercent = timelineTotalRange > 0
|
|
26
|
+
? ((item.duration || 10) / timelineTotalRange) * 100
|
|
27
|
+
: 100;
|
|
28
|
+
const shimmerOpacity = useRef(new Animated.Value(isNew ? 0.35 : 0)).current;
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (isNew) {
|
|
31
|
+
Animated.timing(shimmerOpacity, {
|
|
32
|
+
toValue: 0,
|
|
33
|
+
duration: 1200,
|
|
34
|
+
useNativeDriver: true,
|
|
35
|
+
}).start();
|
|
36
|
+
}
|
|
37
|
+
}, [isNew]);
|
|
38
|
+
const path = getPath(item.url);
|
|
39
|
+
const triggeredAt = formatDateTime(item.startTime);
|
|
40
|
+
const isJson = item.url.split('?')[0].toLowerCase().endsWith('.json');
|
|
41
|
+
return (<TouchableScale onPress={onPress} style={[
|
|
42
|
+
styles.card,
|
|
43
|
+
{
|
|
44
|
+
borderLeftWidth: 4,
|
|
45
|
+
borderLeftColor: cardStatusColor,
|
|
46
|
+
},
|
|
47
|
+
]}>
|
|
48
|
+
<View style={styles.cardBody}>
|
|
49
|
+
<View style={styles.cardTopRow}>
|
|
50
|
+
<Pressable onPress={() => onToggleSelect(item.id)} hitSlop={12} style={[
|
|
51
|
+
styles.smallCheckbox,
|
|
52
|
+
isSelected && styles.smallCheckboxChecked,
|
|
53
|
+
]}>
|
|
54
|
+
{isSelected && (<Svg width={9} height={9} viewBox="0 0 24 24" fill="none">
|
|
55
|
+
<Path d="M20 6L9 17l-5-5" stroke="#FFF" strokeWidth="4" strokeLinecap="round" strokeLinejoin="round"/>
|
|
56
|
+
</Svg>)}
|
|
57
|
+
</Pressable>
|
|
58
|
+
|
|
59
|
+
<Text style={styles.serialNumber}>#{item.id + 1}</Text>
|
|
60
|
+
|
|
61
|
+
<View style={[styles.methodBadge, { backgroundColor: `${methodColor}15` }]}>
|
|
62
|
+
<Text style={[styles.methodBadgeText, { color: methodColor }]}>
|
|
63
|
+
{item.method}
|
|
64
|
+
</Text>
|
|
65
|
+
</View>
|
|
66
|
+
|
|
67
|
+
<HighlightText text={path} search={searchStr} style={styles.urlPathText} highlightStyle={styles.highlight}/>
|
|
68
|
+
|
|
69
|
+
{isJson && (<View style={[
|
|
70
|
+
styles.chip,
|
|
71
|
+
{
|
|
72
|
+
backgroundColor: `${AppColors.darkOrange}15`,
|
|
73
|
+
borderColor: `${AppColors.darkOrange}30`,
|
|
74
|
+
marginLeft: 6,
|
|
75
|
+
},
|
|
76
|
+
]}>
|
|
77
|
+
<Text style={[styles.chipText, { color: AppColors.darkOrange }]}>
|
|
78
|
+
.json
|
|
79
|
+
</Text>
|
|
80
|
+
</View>)}
|
|
81
|
+
</View>
|
|
82
|
+
|
|
83
|
+
<View style={styles.cardBottomRow}>
|
|
84
|
+
<View style={styles.cardDateRow}>
|
|
85
|
+
<CalendarIcon color={AppColors.grayTextWeak} size={11}/>
|
|
86
|
+
<Text style={styles.cardDateText}>{triggeredAt}</Text>
|
|
87
|
+
</View>
|
|
88
|
+
|
|
89
|
+
<View style={styles.cardMetaRow}>
|
|
90
|
+
{item.duration != null && !isFailed && (<View style={[
|
|
91
|
+
styles.chip,
|
|
92
|
+
{
|
|
93
|
+
backgroundColor: `${durationColor}15`,
|
|
94
|
+
borderColor: `${durationColor}30`,
|
|
95
|
+
},
|
|
96
|
+
]}>
|
|
97
|
+
<ClockIcon color={durationColor} size={10}/>
|
|
98
|
+
<Text style={[styles.chipText, { color: durationColor }]}>
|
|
99
|
+
{item.duration}ms
|
|
100
|
+
</Text>
|
|
101
|
+
</View>)}
|
|
102
|
+
|
|
103
|
+
<View style={[
|
|
104
|
+
styles.chip,
|
|
105
|
+
{
|
|
106
|
+
backgroundColor: isFailed
|
|
107
|
+
? `${AppColors.errorColor}15`
|
|
108
|
+
: `${statusColor}15`,
|
|
109
|
+
borderColor: isFailed
|
|
110
|
+
? `${AppColors.errorColor}30`
|
|
111
|
+
: `${statusColor}30`,
|
|
112
|
+
},
|
|
113
|
+
]}>
|
|
114
|
+
<Text style={[
|
|
115
|
+
styles.chipText,
|
|
116
|
+
{ color: isFailed ? AppColors.errorColor : statusColor },
|
|
117
|
+
]}>
|
|
118
|
+
{isFailed ? 'Failed' : item.status}
|
|
119
|
+
</Text>
|
|
120
|
+
</View>
|
|
121
|
+
</View>
|
|
122
|
+
</View>
|
|
123
|
+
|
|
124
|
+
<View style={styles.timelineTrack}>
|
|
125
|
+
<View style={[
|
|
126
|
+
styles.timelineBar,
|
|
127
|
+
{
|
|
128
|
+
left: `${Math.max(0, leftPercent)}%`,
|
|
129
|
+
width: `${Math.min(100, widthPercent)}%`,
|
|
130
|
+
backgroundColor: methodColor,
|
|
131
|
+
},
|
|
132
|
+
]}/>
|
|
133
|
+
</View>
|
|
134
|
+
</View>
|
|
135
|
+
<Animated.View pointerEvents="none" style={[
|
|
136
|
+
StyleSheet.absoluteFill,
|
|
137
|
+
{ backgroundColor: methodColor, opacity: shimmerOpacity },
|
|
138
|
+
]}/>
|
|
139
|
+
</TouchableScale>);
|
|
140
|
+
});
|
|
141
|
+
export default LogCard;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Pressable, Text, Animated } from 'react-native';
|
|
3
|
+
// Constants
|
|
4
|
+
import { DURATION_FAST_MS, DURATION_SLOW_MS } from '../constants';
|
|
5
|
+
// Custom Hooks
|
|
6
|
+
import useAccordion from '../customHooks/useAccordion';
|
|
7
|
+
// Helpers
|
|
8
|
+
import { getDurationColor } from '../helpers';
|
|
9
|
+
// Assets
|
|
10
|
+
import { ChevronIcon, CalendarIcon, StatusIcon, ClockIcon, SizeIcon, } from './NetworkIcons';
|
|
11
|
+
// Stylesheet
|
|
12
|
+
import { AppColors } from '../styles/AppColors';
|
|
13
|
+
import styles from '../styles';
|
|
14
|
+
const MetaAccordion = ({ status, statusColor, duration, size, triggeredAt, }) => {
|
|
15
|
+
const { toggleOpen, chevronStyle, bodyStyle } = useAccordion(true, 400, 260);
|
|
16
|
+
const isFailed = status === 0 || status == null;
|
|
17
|
+
return (<View style={styles.metaContainer}>
|
|
18
|
+
<Pressable onPress={toggleOpen} hitSlop={12}>
|
|
19
|
+
<View style={styles.metaHeader}>
|
|
20
|
+
<Text style={styles.metaTitle}>Metadata</Text>
|
|
21
|
+
<Animated.View style={chevronStyle}>
|
|
22
|
+
<ChevronIcon color={AppColors.grayTextWeak} size={14}/>
|
|
23
|
+
</Animated.View>
|
|
24
|
+
</View>
|
|
25
|
+
</Pressable>
|
|
26
|
+
|
|
27
|
+
<Animated.View style={bodyStyle}>
|
|
28
|
+
<View style={styles.metaBody}>
|
|
29
|
+
<View style={styles.metaRow}>
|
|
30
|
+
<View style={styles.metaLabelRow}>
|
|
31
|
+
<CalendarIcon color={AppColors.grayTextWeak} size={14}/>
|
|
32
|
+
<Text style={styles.metaLabel}>Triggered At</Text>
|
|
33
|
+
</View>
|
|
34
|
+
<Text style={[
|
|
35
|
+
styles.metaValue,
|
|
36
|
+
{ color: AppColors.purple, fontSize: 12 },
|
|
37
|
+
]}>
|
|
38
|
+
{triggeredAt}
|
|
39
|
+
</Text>
|
|
40
|
+
</View>
|
|
41
|
+
<View style={styles.metaDivider}/>
|
|
42
|
+
<View style={styles.metaRow}>
|
|
43
|
+
<View style={styles.metaLabelRow}>
|
|
44
|
+
<StatusIcon color={AppColors.grayTextWeak}/>
|
|
45
|
+
<Text style={styles.metaLabel}>Status</Text>
|
|
46
|
+
</View>
|
|
47
|
+
<View style={[
|
|
48
|
+
styles.statusChip,
|
|
49
|
+
{
|
|
50
|
+
borderColor: isFailed
|
|
51
|
+
? `${AppColors.errorColor}40`
|
|
52
|
+
: `${statusColor}40`,
|
|
53
|
+
backgroundColor: isFailed
|
|
54
|
+
? `${AppColors.errorColor}15`
|
|
55
|
+
: `${statusColor}15`,
|
|
56
|
+
},
|
|
57
|
+
]}>
|
|
58
|
+
<Text style={[
|
|
59
|
+
styles.statusText,
|
|
60
|
+
{ color: isFailed ? AppColors.errorColor : statusColor },
|
|
61
|
+
]}>
|
|
62
|
+
{isFailed ? 'Failed (Network Error)' : String(status)}
|
|
63
|
+
</Text>
|
|
64
|
+
</View>
|
|
65
|
+
</View>
|
|
66
|
+
<View style={styles.metaDivider}/>
|
|
67
|
+
<View style={styles.metaRow}>
|
|
68
|
+
<View style={styles.metaLabelRow}>
|
|
69
|
+
<ClockIcon color={AppColors.grayTextWeak} size={14}/>
|
|
70
|
+
<Text style={styles.metaLabel}>Duration</Text>
|
|
71
|
+
</View>
|
|
72
|
+
<View style={styles.metaValueRow}>
|
|
73
|
+
{duration != null && !isFailed && (<View style={[
|
|
74
|
+
styles.perfBadge,
|
|
75
|
+
{
|
|
76
|
+
backgroundColor: `${getDurationColor(duration)}15`,
|
|
77
|
+
borderColor: `${getDurationColor(duration)}40`,
|
|
78
|
+
},
|
|
79
|
+
]}>
|
|
80
|
+
<Text style={[
|
|
81
|
+
styles.perfBadgeText,
|
|
82
|
+
{ color: getDurationColor(duration) },
|
|
83
|
+
]}>
|
|
84
|
+
{duration < DURATION_FAST_MS
|
|
85
|
+
? 'Fast'
|
|
86
|
+
: duration < DURATION_SLOW_MS
|
|
87
|
+
? 'Moderate'
|
|
88
|
+
: 'Slow'}
|
|
89
|
+
</Text>
|
|
90
|
+
</View>)}
|
|
91
|
+
<Text style={styles.metaValue}>
|
|
92
|
+
{duration != null ? `${duration} ms` : '—'}
|
|
93
|
+
</Text>
|
|
94
|
+
</View>
|
|
95
|
+
</View>
|
|
96
|
+
<View style={styles.metaDivider}/>
|
|
97
|
+
<View style={styles.metaRow}>
|
|
98
|
+
<View style={styles.metaLabelRow}>
|
|
99
|
+
<SizeIcon color={AppColors.grayTextWeak}/>
|
|
100
|
+
<Text style={styles.metaLabel}>Size</Text>
|
|
101
|
+
</View>
|
|
102
|
+
<Text style={styles.metaValue}>{size}</Text>
|
|
103
|
+
</View>
|
|
104
|
+
</View>
|
|
105
|
+
</Animated.View>
|
|
106
|
+
</View>);
|
|
107
|
+
};
|
|
108
|
+
export default MetaAccordion;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Svg, { Rect } from 'react-native-svg';
|
|
3
|
+
const MiniBarChart = ({ data, color, maxVal, }) => {
|
|
4
|
+
if (!data || data.length === 0)
|
|
5
|
+
return <Svg width={40} height={16}/>;
|
|
6
|
+
const max = maxVal || Math.max(...data, 1);
|
|
7
|
+
const paddedData = data.length < 10
|
|
8
|
+
? [...Array(10 - data.length).fill(0), ...data]
|
|
9
|
+
: data.slice(-10);
|
|
10
|
+
return (<Svg width={40} height={16} viewBox="0 0 40 16">
|
|
11
|
+
{paddedData.map((val, i) => {
|
|
12
|
+
const h = Math.max((val / max) * 16, 2);
|
|
13
|
+
const opacity = val === 0 && maxVal === 1 ? 0.2 : 1;
|
|
14
|
+
return (<Rect key={i} x={i * 4} y={16 - h} width={2.5} height={h} fill={color} rx={1} opacity={opacity}/>);
|
|
15
|
+
})}
|
|
16
|
+
</Svg>);
|
|
17
|
+
};
|
|
18
|
+
export default MiniBarChart;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Svg, { Path } from 'react-native-svg';
|
|
3
|
+
const MiniLineChart = ({ data, color }) => {
|
|
4
|
+
if (!data || data.length === 0)
|
|
5
|
+
return <Svg width={40} height={16}/>;
|
|
6
|
+
const paddedData = data.length < 10
|
|
7
|
+
? [...Array(10 - data.length).fill(data[0] || 0), ...data]
|
|
8
|
+
: data.slice(-10);
|
|
9
|
+
const max = Math.max(...paddedData, 1);
|
|
10
|
+
const min = Math.min(...paddedData, 0);
|
|
11
|
+
const range = max - min || 1;
|
|
12
|
+
const dx = 40 / 9;
|
|
13
|
+
const points = paddedData
|
|
14
|
+
.map((d, i) => `${i * dx},${14 - ((d - min) / range) * 12}`)
|
|
15
|
+
.join(' L ');
|
|
16
|
+
return (<Svg width={40} height={16} viewBox="0 0 40 16">
|
|
17
|
+
<Path d={`M ${points}`} fill="none" stroke={color} strokeWidth={1.5} strokeLinecap="round" strokeLinejoin="round"/>
|
|
18
|
+
</Svg>);
|
|
19
|
+
};
|
|
20
|
+
export default MiniLineChart;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const EmptyRadarIcon: ({ color, size }: any) => React.JSX.Element;
|
|
3
|
+
export declare const MapPinIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
4
|
+
export declare const ScreenIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
5
|
+
export declare const ExpandCollapseIcon: ({ isExpanded, color, size, }: any) => React.JSX.Element;
|
|
6
|
+
export declare const SearchIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
7
|
+
export declare const ClearIcon: ({ color, size }: any) => React.JSX.Element;
|
|
8
|
+
export declare const ClockIcon: ({ color, size }: any) => React.JSX.Element;
|
|
9
|
+
export declare const CalendarIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
10
|
+
export declare const StatusIcon: ({ color }: any) => React.JSX.Element;
|
|
11
|
+
export declare const SizeIcon: ({ color }: any) => React.JSX.Element;
|
|
12
|
+
export declare const RequestIcon: ({ color }: any) => React.JSX.Element;
|
|
13
|
+
export declare const ResponseIcon: ({ color }: any) => React.JSX.Element;
|
|
14
|
+
export declare const HeadersIcon: ({ color }: any) => React.JSX.Element;
|
|
15
|
+
export declare const CopyIcon: ({ color, size }: any) => React.JSX.Element;
|
|
16
|
+
export declare const FetchIcon: ({ color, size }: any) => React.JSX.Element;
|
|
17
|
+
export declare const TerminalIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
18
|
+
export declare const CheckIcon: ({ color, size }: any) => React.JSX.Element;
|
|
19
|
+
export declare const FailIcon: ({ color, size }: any) => React.JSX.Element;
|
|
20
|
+
export declare const TrashIcon: ({ color, size }: any) => React.JSX.Element;
|
|
21
|
+
export declare const HeaderPauseIcon: ({ isPaused, color, size, }: any) => React.JSX.Element;
|
|
22
|
+
export declare const ExportIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
23
|
+
export declare const SignalIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
24
|
+
export declare const DiffIcon: ({ color, size }: any) => React.JSX.Element;
|
|
25
|
+
export declare const GlobeIcon: ({ color, size }: any) => React.JSX.Element;
|
|
26
|
+
export declare const SortArrowIcon: ({ color, size, direction, }: any) => React.JSX.Element;
|
|
27
|
+
export declare const ChevronIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
28
|
+
export declare const FilterIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
29
|
+
export declare const DownloadIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
30
|
+
export declare const CloseWhite: ({ color, size }: any) => React.JSX.Element;
|
|
31
|
+
export declare const WhiteBackNavigation: ({ color, size }: any) => React.JSX.Element;
|