react-native-inapp-inspector 1.1.13 → 1.1.15
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 +9 -34
- package/dist/commonjs/assets/svgAssets.d.ts +3 -0
- package/dist/commonjs/assets/svgAssets.js +17 -0
- package/dist/commonjs/components/AnalyticsEventCard.d.ts +1 -14
- package/dist/commonjs/components/AnalyticsEventCard.js +120 -50
- package/dist/commonjs/components/AnalyticsGraph.d.ts +2 -6
- package/dist/commonjs/components/AnalyticsGraph.js +8 -8
- package/dist/commonjs/components/AnalyticsTabView.d.ts +15 -0
- package/dist/commonjs/components/AnalyticsTabView.js +157 -0
- package/dist/commonjs/components/AnimatedEntrance.d.ts +1 -1
- package/dist/commonjs/components/AnimatedEntrance.js +2 -2
- package/dist/commonjs/components/ApiDetailView.d.ts +22 -0
- package/dist/commonjs/components/ApiDetailView.js +304 -0
- package/dist/commonjs/components/ApisTabView.d.ts +33 -0
- package/dist/commonjs/components/ApisTabView.js +235 -0
- package/dist/commonjs/components/CodeSnippet.d.ts +1 -5
- package/dist/commonjs/components/CodeSnippet.js +34 -34
- package/dist/commonjs/components/ConsoleLogCard.d.ts +1 -8
- package/dist/commonjs/components/ConsoleLogCard.js +262 -442
- package/dist/commonjs/components/ConsoleLogDetailView.d.ts +9 -0
- package/dist/commonjs/components/ConsoleLogDetailView.js +278 -0
- package/dist/commonjs/components/ConsoleLogsTabView.d.ts +24 -0
- package/dist/commonjs/components/ConsoleLogsTabView.js +354 -0
- package/dist/commonjs/components/DiffViewer.js +4 -2
- package/dist/commonjs/components/DomainHeader.js +66 -41
- package/dist/commonjs/components/EmptyState.d.ts +2 -2
- package/dist/commonjs/components/EmptyState.js +2 -2
- package/dist/commonjs/components/EndOfListFooter.d.ts +8 -0
- package/dist/commonjs/components/EndOfListFooter.js +90 -0
- package/dist/commonjs/components/ErrorBoundary.d.ts +5 -14
- package/dist/commonjs/components/ErrorBoundary.js +28 -28
- package/dist/commonjs/components/FloatingBubble.d.ts +14 -0
- package/dist/commonjs/components/FloatingBubble.js +75 -0
- package/dist/commonjs/components/HeadersSection.js +5 -3
- package/dist/commonjs/components/HighlightText.d.ts +1 -1
- package/dist/commonjs/components/HighlightText.js +5 -7
- package/dist/commonjs/components/Inspector/AnalyticsTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +232 -0
- package/dist/commonjs/components/Inspector/ConsoleTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/ConsoleTab.js +410 -0
- package/dist/commonjs/components/Inspector/FabLauncher.d.ts +3 -0
- package/dist/commonjs/components/Inspector/FabLauncher.js +54 -0
- package/dist/commonjs/components/Inspector/InsightsDashboard.d.ts +3 -0
- package/dist/commonjs/components/Inspector/InsightsDashboard.js +619 -0
- package/dist/commonjs/components/Inspector/InspectorContext.d.ts +5 -0
- package/dist/commonjs/components/Inspector/InspectorContext.js +18 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.d.ts +3 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.js +452 -0
- package/dist/commonjs/components/Inspector/LogDetail.d.ts +3 -0
- package/dist/commonjs/components/Inspector/LogDetail.js +963 -0
- package/dist/commonjs/components/Inspector/MainScreen.d.ts +3 -0
- package/dist/commonjs/components/Inspector/MainScreen.js +68 -0
- package/dist/commonjs/components/Inspector/NavigationTracker.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NavigationTracker.js +12 -0
- package/dist/commonjs/components/Inspector/NetworkDetail.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NetworkDetail.js +405 -0
- package/dist/commonjs/components/Inspector/NetworkTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NetworkTab.js +281 -0
- package/dist/commonjs/components/Inspector/ReduxTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/ReduxTab.js +75 -0
- package/dist/commonjs/components/Inspector/SettingsPanel.d.ts +3 -0
- package/dist/commonjs/components/Inspector/SettingsPanel.js +1476 -0
- package/dist/commonjs/components/Inspector/TabBar.d.ts +3 -0
- package/dist/commonjs/components/Inspector/TabBar.js +95 -0
- package/dist/commonjs/components/Inspector/WebViewTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/WebViewTab.js +757 -0
- package/dist/commonjs/components/InspectorHeader.d.ts +19 -0
- package/dist/commonjs/components/InspectorHeader.js +329 -0
- package/dist/commonjs/components/InspectorTabBar.d.ts +16 -0
- package/dist/commonjs/components/InspectorTabBar.js +90 -0
- package/dist/commonjs/components/JsonViewer.d.ts +4 -1
- package/dist/commonjs/components/JsonViewer.js +110 -171
- package/dist/commonjs/components/LogCard.js +109 -86
- package/dist/commonjs/components/MetaAccordion.d.ts +1 -10
- package/dist/commonjs/components/MetaAccordion.js +23 -21
- package/dist/commonjs/components/NavigationTracker.d.ts +7 -0
- package/dist/commonjs/components/NavigationTracker.js +76 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +6 -0
- package/dist/commonjs/components/NetworkIcons.js +54 -8
- package/dist/commonjs/components/ReduxTabView.d.ts +9 -0
- package/dist/commonjs/components/ReduxTabView.js +56 -0
- package/dist/commonjs/components/ReduxTreeView.js +241 -200
- package/dist/commonjs/components/SegmentedTabs.d.ts +15 -0
- package/dist/commonjs/components/SegmentedTabs.js +52 -0
- package/dist/commonjs/components/SettingsView.d.ts +13 -0
- package/dist/commonjs/components/SettingsView.js +328 -0
- package/dist/commonjs/components/TouchableScale.d.ts +2 -2
- package/dist/commonjs/components/TouchableScale.js +2 -2
- package/dist/commonjs/components/TreeNode.js +2 -2
- package/dist/commonjs/constants/index.js +1 -12
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/analyticsLogger.d.ts +8 -0
- package/dist/commonjs/customHooks/analyticsLogger.js +42 -1
- package/dist/commonjs/customHooks/consoleLogger.js +137 -13
- package/dist/commonjs/customHooks/networkLogger.d.ts +0 -1
- package/dist/commonjs/customHooks/networkLogger.js +0 -1
- package/dist/commonjs/customHooks/reduxLogger.d.ts +2 -9
- package/dist/commonjs/enums/index.d.ts +39 -0
- package/dist/commonjs/enums/index.js +50 -0
- package/dist/commonjs/helpers/index.d.ts +27 -1
- package/dist/commonjs/helpers/index.js +187 -12
- package/dist/commonjs/helpers/settingsStore.d.ts +2 -24
- package/dist/commonjs/i18n/en.json +144 -0
- package/dist/commonjs/i18n/index.d.ts +2 -0
- package/dist/commonjs/i18n/index.js +27 -0
- package/dist/commonjs/i18n/locales/en.json +314 -0
- package/dist/commonjs/index.d.ts +2 -3
- package/dist/commonjs/index.js +207 -4927
- package/dist/commonjs/styles/AppColors.d.ts +148 -0
- package/dist/commonjs/styles/AppColors.js +176 -0
- package/dist/commonjs/styles/common.d.ts +3 -0
- package/dist/commonjs/styles/common.js +201 -0
- package/dist/commonjs/styles/index.d.ts +219 -435
- package/dist/commonjs/styles/index.js +312 -488
- package/dist/commonjs/types/enums.d.ts +9 -0
- package/dist/commonjs/types/enums.js +4 -0
- package/dist/commonjs/types/index.d.ts +4 -111
- package/dist/commonjs/types/index.js +16 -0
- package/dist/commonjs/types/interfaces.d.ts +337 -0
- package/dist/commonjs/types/interfaces.js +2 -0
- package/dist/esm/assets/svgAssets.d.ts +3 -0
- package/dist/esm/assets/svgAssets.js +14 -0
- package/dist/esm/components/AnalyticsEventCard.d.ts +1 -14
- package/dist/esm/components/AnalyticsEventCard.js +118 -48
- package/dist/esm/components/AnalyticsGraph.d.ts +2 -6
- package/dist/esm/components/AnalyticsGraph.js +8 -8
- package/dist/esm/components/AnalyticsTabView.d.ts +15 -0
- package/dist/esm/components/AnalyticsTabView.js +151 -0
- package/dist/esm/components/AnimatedEntrance.d.ts +1 -1
- package/dist/esm/components/AnimatedEntrance.js +2 -2
- package/dist/esm/components/ApiDetailView.d.ts +22 -0
- package/dist/esm/components/ApiDetailView.js +264 -0
- package/dist/esm/components/ApisTabView.d.ts +33 -0
- package/dist/esm/components/ApisTabView.js +196 -0
- package/dist/esm/components/CodeSnippet.d.ts +1 -5
- package/dist/esm/components/CodeSnippet.js +34 -34
- package/dist/esm/components/ConsoleLogCard.d.ts +1 -8
- package/dist/esm/components/ConsoleLogCard.js +262 -409
- package/dist/esm/components/ConsoleLogDetailView.d.ts +9 -0
- package/dist/esm/components/ConsoleLogDetailView.js +271 -0
- package/dist/esm/components/ConsoleLogsTabView.d.ts +24 -0
- package/dist/esm/components/ConsoleLogsTabView.js +348 -0
- package/dist/esm/components/DiffViewer.js +4 -2
- package/dist/esm/components/DomainHeader.js +66 -41
- package/dist/esm/components/EmptyState.d.ts +2 -2
- package/dist/esm/components/EmptyState.js +2 -2
- package/dist/esm/components/EndOfListFooter.d.ts +8 -0
- package/dist/esm/components/EndOfListFooter.js +83 -0
- package/dist/esm/components/ErrorBoundary.d.ts +5 -14
- package/dist/esm/components/ErrorBoundary.js +29 -29
- package/dist/esm/components/FloatingBubble.d.ts +14 -0
- package/dist/esm/components/FloatingBubble.js +68 -0
- package/dist/esm/components/HeadersSection.js +5 -3
- package/dist/esm/components/HighlightText.d.ts +1 -1
- package/dist/esm/components/HighlightText.js +5 -7
- package/dist/esm/components/Inspector/AnalyticsTab.d.ts +3 -0
- package/dist/esm/components/Inspector/AnalyticsTab.js +194 -0
- package/dist/esm/components/Inspector/ConsoleTab.d.ts +3 -0
- package/dist/esm/components/Inspector/ConsoleTab.js +372 -0
- package/dist/esm/components/Inspector/FabLauncher.d.ts +3 -0
- package/dist/esm/components/Inspector/FabLauncher.js +49 -0
- package/dist/esm/components/Inspector/InsightsDashboard.d.ts +3 -0
- package/dist/esm/components/Inspector/InsightsDashboard.js +614 -0
- package/dist/esm/components/Inspector/InspectorContext.d.ts +5 -0
- package/dist/esm/components/Inspector/InspectorContext.js +13 -0
- package/dist/esm/components/Inspector/InspectorHeader.d.ts +3 -0
- package/dist/esm/components/Inspector/InspectorHeader.js +447 -0
- package/dist/esm/components/Inspector/LogDetail.d.ts +3 -0
- package/dist/esm/components/Inspector/LogDetail.js +925 -0
- package/dist/esm/components/Inspector/MainScreen.d.ts +3 -0
- package/dist/esm/components/Inspector/MainScreen.js +63 -0
- package/dist/esm/components/Inspector/NavigationTracker.d.ts +3 -0
- package/dist/esm/components/Inspector/NavigationTracker.js +10 -0
- package/dist/esm/components/Inspector/NetworkDetail.d.ts +3 -0
- package/dist/esm/components/Inspector/NetworkDetail.js +367 -0
- package/dist/esm/components/Inspector/NetworkTab.d.ts +3 -0
- package/dist/esm/components/Inspector/NetworkTab.js +243 -0
- package/dist/esm/components/Inspector/ReduxTab.d.ts +3 -0
- package/dist/esm/components/Inspector/ReduxTab.js +70 -0
- package/dist/esm/components/Inspector/SettingsPanel.d.ts +3 -0
- package/dist/esm/components/Inspector/SettingsPanel.js +1438 -0
- package/dist/esm/components/Inspector/TabBar.d.ts +3 -0
- package/dist/esm/components/Inspector/TabBar.js +90 -0
- package/dist/esm/components/Inspector/WebViewTab.d.ts +3 -0
- package/dist/esm/components/Inspector/WebViewTab.js +752 -0
- package/dist/esm/components/InspectorHeader.d.ts +19 -0
- package/dist/esm/components/InspectorHeader.js +323 -0
- package/dist/esm/components/InspectorTabBar.d.ts +16 -0
- package/dist/esm/components/InspectorTabBar.js +84 -0
- package/dist/esm/components/JsonViewer.d.ts +4 -1
- package/dist/esm/components/JsonViewer.js +111 -172
- package/dist/esm/components/LogCard.js +111 -88
- package/dist/esm/components/MetaAccordion.d.ts +1 -10
- package/dist/esm/components/MetaAccordion.js +23 -21
- package/dist/esm/components/NavigationTracker.d.ts +7 -0
- package/dist/esm/components/NavigationTracker.js +39 -0
- package/dist/esm/components/NetworkIcons.d.ts +6 -0
- package/dist/esm/components/NetworkIcons.js +46 -6
- package/dist/esm/components/ReduxTabView.d.ts +9 -0
- package/dist/esm/components/ReduxTabView.js +50 -0
- package/dist/esm/components/ReduxTreeView.js +243 -202
- package/dist/esm/components/SegmentedTabs.d.ts +15 -0
- package/dist/esm/components/SegmentedTabs.js +47 -0
- package/dist/esm/components/SettingsView.d.ts +13 -0
- package/dist/esm/components/SettingsView.js +321 -0
- package/dist/esm/components/TouchableScale.d.ts +2 -2
- package/dist/esm/components/TouchableScale.js +2 -2
- package/dist/esm/components/TreeNode.js +2 -2
- package/dist/esm/constants/index.js +1 -12
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/analyticsLogger.d.ts +8 -0
- package/dist/esm/customHooks/analyticsLogger.js +37 -0
- package/dist/esm/customHooks/consoleLogger.js +137 -13
- package/dist/esm/customHooks/networkLogger.d.ts +0 -1
- package/dist/esm/customHooks/networkLogger.js +0 -1
- package/dist/esm/customHooks/reduxLogger.d.ts +2 -9
- package/dist/esm/enums/index.d.ts +39 -0
- package/dist/esm/enums/index.js +47 -0
- package/dist/esm/helpers/index.d.ts +27 -1
- package/dist/esm/helpers/index.js +180 -11
- package/dist/esm/helpers/settingsStore.d.ts +2 -24
- package/dist/esm/i18n/en.json +144 -0
- package/dist/esm/i18n/index.d.ts +2 -0
- package/dist/esm/i18n/index.js +22 -0
- package/dist/esm/i18n/locales/en.json +314 -0
- package/dist/esm/index.d.ts +2 -3
- package/dist/esm/index.js +207 -4923
- package/dist/esm/styles/AppColors.d.ts +148 -0
- package/dist/esm/styles/AppColors.js +176 -0
- package/dist/esm/styles/common.d.ts +3 -0
- package/dist/esm/styles/common.js +197 -0
- package/dist/esm/styles/index.d.ts +219 -435
- package/dist/esm/styles/index.js +312 -488
- package/dist/esm/types/enums.d.ts +9 -0
- package/dist/esm/types/enums.js +3 -0
- package/dist/esm/types/index.d.ts +4 -111
- package/dist/esm/types/index.js +2 -1
- package/dist/esm/types/interfaces.d.ts +337 -0
- package/dist/esm/types/interfaces.js +1 -0
- package/example/App.tsx +88 -1
- package/example/android/app/build.gradle +29 -1
- package/example/android/app/src/main/java/com/example/MainApplication.kt +25 -0
- package/example/android/build.gradle +31 -4
- package/example/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/example/android/gradle.properties +1 -0
- package/example/android/settings.gradle +20 -1
- package/example/package-lock.json +1 -1
- package/package.json +3 -1
|
@@ -22,77 +22,102 @@ const DomainHeader = ({ pageName, color, stats, activeFilters, onToggleFilter, i
|
|
|
22
22
|
outputRange: ['-90deg', '0deg'],
|
|
23
23
|
});
|
|
24
24
|
const visibleStats = ['success', 'failed', 'loading'];
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<View style={
|
|
32
|
-
<
|
|
33
|
-
{
|
|
34
|
-
</
|
|
35
|
-
<View style={styles.
|
|
36
|
-
<
|
|
25
|
+
const total = stats.success + stats.failed + stats.loading;
|
|
26
|
+
const pctSuccess = total > 0 ? Math.round((stats.success / total) * 100) : 0;
|
|
27
|
+
const pctFailed = total > 0 ? Math.round((stats.failed / total) * 100) : 0;
|
|
28
|
+
const pctLoading = total > 0 ? Math.round((stats.loading / total) * 100) : 0;
|
|
29
|
+
return (<Pressable style={styles.domainHeaderCard} onPress={() => onToggleCollapse(pageName)}>
|
|
30
|
+
<View style={styles.domainHeaderTopRow}>
|
|
31
|
+
<View style={styles.domainHeaderLeft}>
|
|
32
|
+
<Animated.View style={{ transform: [{ rotate: chevronRotate }] }}>
|
|
33
|
+
<ChevronIcon color={AppColors.grayTextWeak} size={13}/>
|
|
34
|
+
</Animated.View>
|
|
35
|
+
<View style={[styles.domainIconWrap, { backgroundColor: `${color}18` }]}>
|
|
36
|
+
<ScreenIcon color={color} size={14}/>
|
|
37
|
+
</View>
|
|
38
|
+
<View style={{ flex: 1, justifyContent: 'center' }}>
|
|
39
|
+
<Text style={styles.domainTitleText} numberOfLines={1}>
|
|
40
|
+
{pageName}
|
|
41
|
+
</Text>
|
|
42
|
+
<Text style={styles.domainSummaryText} numberOfLines={1}>
|
|
37
43
|
{formatDateTime(timestamp)}
|
|
38
44
|
</Text>
|
|
39
45
|
</View>
|
|
40
46
|
</View>
|
|
41
|
-
</View>
|
|
42
47
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const isLast = index === visibleStats.length - 1;
|
|
48
|
+
<View style={styles.domainStatsGroup}>
|
|
49
|
+
{visibleStats.map(type => {
|
|
46
50
|
const isActive = activeFilters.has(type);
|
|
47
51
|
let IconComponent;
|
|
48
52
|
let activeColor = '';
|
|
49
53
|
let count = 0;
|
|
50
|
-
let bgStyle = {};
|
|
51
54
|
if (type === 'success') {
|
|
52
55
|
IconComponent = CheckIcon;
|
|
53
56
|
activeColor = AppColors.greenColor;
|
|
54
57
|
count = stats.success;
|
|
55
|
-
bgStyle = {
|
|
56
|
-
backgroundColor: isActive
|
|
57
|
-
? `${AppColors.greenColor}15`
|
|
58
|
-
: 'transparent',
|
|
59
|
-
};
|
|
60
58
|
}
|
|
61
59
|
else if (type === 'failed') {
|
|
62
60
|
IconComponent = FailIcon;
|
|
63
61
|
activeColor = AppColors.errorColor;
|
|
64
62
|
count = stats.failed;
|
|
65
|
-
bgStyle = {
|
|
66
|
-
backgroundColor: isActive
|
|
67
|
-
? `${AppColors.errorColor}15`
|
|
68
|
-
: 'transparent',
|
|
69
|
-
};
|
|
70
63
|
}
|
|
71
64
|
else {
|
|
72
65
|
IconComponent = ClockIcon;
|
|
73
66
|
activeColor = AppColors.darkOrange;
|
|
74
67
|
count = stats.loading;
|
|
75
|
-
bgStyle = {
|
|
76
|
-
backgroundColor: isActive
|
|
77
|
-
? `${AppColors.darkOrange}15`
|
|
78
|
-
: 'transparent',
|
|
79
|
-
};
|
|
80
68
|
}
|
|
81
|
-
return (<Pressable key={type} onPress={() => onToggleFilter(pageName, type)} style={[
|
|
82
|
-
styles.
|
|
83
|
-
|
|
84
|
-
|
|
69
|
+
return (<Pressable key={type} onPress={() => onToggleFilter(pageName, type)} hitSlop={6} style={[
|
|
70
|
+
styles.domainStatPill,
|
|
71
|
+
isActive && {
|
|
72
|
+
borderColor: `${activeColor}40`,
|
|
73
|
+
backgroundColor: `${activeColor}12`,
|
|
74
|
+
},
|
|
85
75
|
]}>
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
<View style={[
|
|
77
|
+
styles.filterCheckbox,
|
|
78
|
+
{ marginRight: 0, width: 11, height: 11, borderRadius: 2.5 },
|
|
79
|
+
isActive && [
|
|
80
|
+
styles.filterCheckboxActive,
|
|
81
|
+
{ backgroundColor: activeColor },
|
|
82
|
+
],
|
|
83
|
+
]}>
|
|
84
|
+
{isActive && (<CheckIcon color={AppColors.white} size={7}/>)}
|
|
85
|
+
</View>
|
|
86
|
+
<IconComponent color={isActive ? activeColor : AppColors.grayTextWeak} size={type === 'failed' ? 8 : 10}/>
|
|
87
|
+
<Text style={[
|
|
88
88
|
styles.domainStatText,
|
|
89
89
|
{ color: isActive ? activeColor : AppColors.grayTextWeak },
|
|
90
90
|
]}>
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
{count}
|
|
92
|
+
</Text>
|
|
93
|
+
</Pressable>);
|
|
94
94
|
})}
|
|
95
|
+
</View>
|
|
95
96
|
</View>
|
|
97
|
+
|
|
98
|
+
{total > 0 && (<View style={styles.domainProgressTrack}>
|
|
99
|
+
{pctSuccess > 0 && (<View style={[
|
|
100
|
+
styles.domainProgressSegment,
|
|
101
|
+
{
|
|
102
|
+
width: `${pctSuccess}%`,
|
|
103
|
+
backgroundColor: AppColors.greenColor,
|
|
104
|
+
},
|
|
105
|
+
]}/>)}
|
|
106
|
+
{pctFailed > 0 && (<View style={[
|
|
107
|
+
styles.domainProgressSegment,
|
|
108
|
+
{
|
|
109
|
+
width: `${pctFailed}%`,
|
|
110
|
+
backgroundColor: AppColors.errorColor,
|
|
111
|
+
},
|
|
112
|
+
]}/>)}
|
|
113
|
+
{pctLoading > 0 && (<View style={[
|
|
114
|
+
styles.domainProgressSegment,
|
|
115
|
+
{
|
|
116
|
+
width: `${pctLoading}%`,
|
|
117
|
+
backgroundColor: AppColors.darkOrange,
|
|
118
|
+
},
|
|
119
|
+
]}/>)}
|
|
120
|
+
</View>)}
|
|
96
121
|
</Pressable>);
|
|
97
122
|
};
|
|
98
123
|
export default DomainHeader;
|
|
@@ -8,7 +8,7 @@ import { EmptyRadarIcon } from './NetworkIcons';
|
|
|
8
8
|
// Stylesheet
|
|
9
9
|
import { AppColors } from '../styles/AppColors';
|
|
10
10
|
import styles from '../styles';
|
|
11
|
-
const EmptyState = ({ isSearch })
|
|
11
|
+
const EmptyState = React.memo(function EmptyState({ isSearch }) {
|
|
12
12
|
const iconPulse = useRef(new Animated.Value(1)).current;
|
|
13
13
|
useEffect(() => {
|
|
14
14
|
const loop = Animated.loop(Animated.sequence([
|
|
@@ -49,5 +49,5 @@ const EmptyState = ({ isSearch }) => {
|
|
|
49
49
|
<Text style={styles.reloadBtnText}>Reload App</Text>
|
|
50
50
|
</TouchableScale>)}
|
|
51
51
|
</AnimatedEntrance>);
|
|
52
|
-
};
|
|
52
|
+
});
|
|
53
53
|
export default EmptyState;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
import { AppColors } from '../styles/AppColors';
|
|
4
|
+
import { AppFonts } from '../styles/AppFonts';
|
|
5
|
+
import { CheckIcon } from './NetworkIcons';
|
|
6
|
+
export const EndOfListFooter = ({ count, label, message = "You've reached the end of the list", }) => {
|
|
7
|
+
return (<View style={styles.container}>
|
|
8
|
+
<View style={styles.dividerLine}/>
|
|
9
|
+
<View style={styles.badgePill}>
|
|
10
|
+
<View style={styles.iconCircle}>
|
|
11
|
+
<CheckIcon color={AppColors.purple} size={8}/>
|
|
12
|
+
</View>
|
|
13
|
+
<Text style={styles.messageText}>{message}</Text>
|
|
14
|
+
{count != null && count > 0 && (<View style={styles.countBadge}>
|
|
15
|
+
<Text style={styles.countText}>
|
|
16
|
+
{count} {label ? (count === 1 ? label.replace(/s$/, '') : label) : ''}
|
|
17
|
+
</Text>
|
|
18
|
+
</View>)}
|
|
19
|
+
</View>
|
|
20
|
+
<View style={styles.dividerLine}/>
|
|
21
|
+
</View>);
|
|
22
|
+
};
|
|
23
|
+
const styles = StyleSheet.create({
|
|
24
|
+
container: {
|
|
25
|
+
flexDirection: 'row',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
justifyContent: 'center',
|
|
28
|
+
paddingHorizontal: 16,
|
|
29
|
+
paddingTop: 16,
|
|
30
|
+
paddingBottom: 28,
|
|
31
|
+
gap: 8,
|
|
32
|
+
},
|
|
33
|
+
dividerLine: {
|
|
34
|
+
flex: 1,
|
|
35
|
+
height: 1,
|
|
36
|
+
backgroundColor: AppColors.dividerColor,
|
|
37
|
+
opacity: 0.7,
|
|
38
|
+
},
|
|
39
|
+
badgePill: {
|
|
40
|
+
flexDirection: 'row',
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
gap: 6,
|
|
43
|
+
paddingHorizontal: 10,
|
|
44
|
+
paddingVertical: 5,
|
|
45
|
+
borderRadius: 999,
|
|
46
|
+
backgroundColor: AppColors.primaryLight,
|
|
47
|
+
borderWidth: 1,
|
|
48
|
+
borderColor: AppColors.grayBorderSecondary,
|
|
49
|
+
shadowColor: AppColors.black,
|
|
50
|
+
shadowOffset: { width: 0, height: 1 },
|
|
51
|
+
shadowOpacity: 0.04,
|
|
52
|
+
shadowRadius: 2,
|
|
53
|
+
elevation: 1,
|
|
54
|
+
},
|
|
55
|
+
iconCircle: {
|
|
56
|
+
width: 14,
|
|
57
|
+
height: 14,
|
|
58
|
+
borderRadius: 7,
|
|
59
|
+
backgroundColor: `${AppColors.purple}18`,
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
justifyContent: 'center',
|
|
62
|
+
},
|
|
63
|
+
messageText: {
|
|
64
|
+
fontFamily: AppFonts.interMedium,
|
|
65
|
+
fontSize: 11,
|
|
66
|
+
color: AppColors.grayTextWeak,
|
|
67
|
+
letterSpacing: 0.1,
|
|
68
|
+
},
|
|
69
|
+
countBadge: {
|
|
70
|
+
paddingHorizontal: 5,
|
|
71
|
+
paddingVertical: 1,
|
|
72
|
+
borderRadius: 6,
|
|
73
|
+
backgroundColor: AppColors.grayBackground,
|
|
74
|
+
borderWidth: 1,
|
|
75
|
+
borderColor: AppColors.grayBorderSecondary,
|
|
76
|
+
},
|
|
77
|
+
countText: {
|
|
78
|
+
fontFamily: AppFonts.interBold,
|
|
79
|
+
fontSize: 9.5,
|
|
80
|
+
color: AppColors.grayTextStrong,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
export default EndOfListFooter;
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
import React, { Component, ErrorInfo
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
fallbackType?: 'modal' | 'inline';
|
|
7
|
-
}
|
|
8
|
-
interface State {
|
|
9
|
-
hasError: boolean;
|
|
10
|
-
error: Error | null;
|
|
11
|
-
}
|
|
12
|
-
export declare class ErrorBoundary extends Component<Props, State> {
|
|
13
|
-
state: State;
|
|
14
|
-
static getDerivedStateFromError(error: Error): State;
|
|
1
|
+
import React, { Component, ErrorInfo } from 'react';
|
|
2
|
+
import { ErrorBoundaryProps, ErrorBoundaryState } from '../types';
|
|
3
|
+
export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
4
|
+
state: ErrorBoundaryState;
|
|
5
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
15
6
|
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
16
7
|
private handleReset;
|
|
17
8
|
private handleCopyTrace;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import { StyleSheet, Text, View, ScrollView, TouchableOpacity
|
|
2
|
+
import { StyleSheet, Text, View, ScrollView, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { AppColors } from '../styles/AppColors';
|
|
4
4
|
import { AppFonts } from '../styles/AppFonts';
|
|
5
5
|
import { copyToClipboard } from '../helpers';
|
|
@@ -91,7 +91,7 @@ ${error.stack}`;
|
|
|
91
91
|
<View style={{
|
|
92
92
|
flexDirection: 'row',
|
|
93
93
|
alignItems: 'center',
|
|
94
|
-
backgroundColor: isNativeCrash ?
|
|
94
|
+
backgroundColor: isNativeCrash ? `${AppColors.errorColor}1A` : `${AppColors.amber500}1A`,
|
|
95
95
|
paddingHorizontal: 10,
|
|
96
96
|
paddingVertical: 4,
|
|
97
97
|
borderRadius: 20,
|
|
@@ -101,7 +101,7 @@ ${error.stack}`;
|
|
|
101
101
|
<Text style={{
|
|
102
102
|
fontSize: 10,
|
|
103
103
|
fontWeight: 'bold',
|
|
104
|
-
color: isNativeCrash ?
|
|
104
|
+
color: isNativeCrash ? AppColors.errorColor : AppColors.amber500,
|
|
105
105
|
fontFamily: AppFonts.interBold || 'System'
|
|
106
106
|
}}>
|
|
107
107
|
{isNativeCrash ? '🔴 NATIVE CRASH' : '🟡 JAVASCRIPT CRASH'}
|
|
@@ -113,22 +113,22 @@ ${error.stack}`;
|
|
|
113
113
|
</Text>
|
|
114
114
|
|
|
115
115
|
{parsed && (<View style={{
|
|
116
|
-
backgroundColor:
|
|
116
|
+
backgroundColor: AppColors.slate100,
|
|
117
117
|
borderRadius: 8,
|
|
118
118
|
padding: 10,
|
|
119
119
|
width: '100%',
|
|
120
120
|
marginBottom: 10,
|
|
121
121
|
borderWidth: 1,
|
|
122
|
-
borderColor:
|
|
122
|
+
borderColor: AppColors.slate200,
|
|
123
123
|
gap: 4
|
|
124
124
|
}}>
|
|
125
|
-
<Text style={{ fontSize: 11, color:
|
|
125
|
+
<Text style={{ fontSize: 11, color: AppColors.slate600, fontFamily: AppFonts.interMedium }} numberOfLines={1}>
|
|
126
126
|
<Text style={{ fontWeight: 'bold' }}>Method:</Text> {parsed.method}
|
|
127
127
|
</Text>
|
|
128
|
-
<Text style={{ fontSize: 11, color:
|
|
128
|
+
<Text style={{ fontSize: 11, color: AppColors.slate600, fontFamily: AppFonts.interMedium }} numberOfLines={1}>
|
|
129
129
|
<Text style={{ fontWeight: 'bold' }}>File:</Text> {parsed.file}
|
|
130
130
|
</Text>
|
|
131
|
-
<Text style={{ fontSize: 11, color:
|
|
131
|
+
<Text style={{ fontSize: 11, color: AppColors.slate600, fontFamily: AppFonts.interMedium }}>
|
|
132
132
|
<Text style={{ fontWeight: 'bold' }}>Line:</Text> {parsed.line} <Text style={{ fontWeight: 'bold' }}>Col:</Text> {parsed.column}
|
|
133
133
|
</Text>
|
|
134
134
|
</View>)}
|
|
@@ -143,7 +143,7 @@ ${error.stack}`;
|
|
|
143
143
|
|
|
144
144
|
<View style={{ width: '100%', gap: 8, marginBottom: 12 }}>
|
|
145
145
|
<TouchableOpacity style={{
|
|
146
|
-
backgroundColor:
|
|
146
|
+
backgroundColor: AppColors.slate900,
|
|
147
147
|
height: 38,
|
|
148
148
|
borderRadius: 8,
|
|
149
149
|
justifyContent: 'center',
|
|
@@ -151,7 +151,7 @@ ${error.stack}`;
|
|
|
151
151
|
flexDirection: 'row',
|
|
152
152
|
gap: 6
|
|
153
153
|
}} onPress={this.handleCopyTrace}>
|
|
154
|
-
<Text style={{ color:
|
|
154
|
+
<Text style={{ color: AppColors.white, fontSize: 12, fontWeight: 'bold', fontFamily: AppFonts.interBold || 'System' }}>
|
|
155
155
|
📋 Copy Crash Traceback
|
|
156
156
|
</Text>
|
|
157
157
|
</TouchableOpacity>
|
|
@@ -172,11 +172,11 @@ ${error.stack}`;
|
|
|
172
172
|
return this.props.children;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
const monoFont =
|
|
175
|
+
const monoFont = AppFonts.interRegular;
|
|
176
176
|
const styles = StyleSheet.create({
|
|
177
177
|
container: {
|
|
178
178
|
flex: 1,
|
|
179
|
-
backgroundColor:
|
|
179
|
+
backgroundColor: `${AppColors.black}4D`,
|
|
180
180
|
justifyContent: 'center',
|
|
181
181
|
alignItems: 'center',
|
|
182
182
|
padding: 16,
|
|
@@ -184,11 +184,11 @@ const styles = StyleSheet.create({
|
|
|
184
184
|
card: {
|
|
185
185
|
width: '100%',
|
|
186
186
|
maxWidth: 400,
|
|
187
|
-
backgroundColor:
|
|
187
|
+
backgroundColor: AppColors.white,
|
|
188
188
|
borderRadius: 16,
|
|
189
189
|
padding: 20,
|
|
190
190
|
alignItems: 'center',
|
|
191
|
-
shadowColor:
|
|
191
|
+
shadowColor: AppColors.black,
|
|
192
192
|
shadowOffset: { width: 0, height: 4 },
|
|
193
193
|
shadowOpacity: 0.1,
|
|
194
194
|
shadowRadius: 12,
|
|
@@ -201,14 +201,14 @@ const styles = StyleSheet.create({
|
|
|
201
201
|
title: {
|
|
202
202
|
fontFamily: AppFonts.interBold || 'System',
|
|
203
203
|
fontSize: 18,
|
|
204
|
-
color:
|
|
204
|
+
color: AppColors.slate900,
|
|
205
205
|
marginBottom: 8,
|
|
206
206
|
textAlign: 'center',
|
|
207
207
|
},
|
|
208
208
|
subtitle: {
|
|
209
209
|
fontFamily: AppFonts.interRegular || 'System',
|
|
210
210
|
fontSize: 12,
|
|
211
|
-
color:
|
|
211
|
+
color: AppColors.slate500,
|
|
212
212
|
lineHeight: 18,
|
|
213
213
|
textAlign: 'center',
|
|
214
214
|
marginBottom: 16,
|
|
@@ -216,10 +216,10 @@ const styles = StyleSheet.create({
|
|
|
216
216
|
scroll: {
|
|
217
217
|
width: '100%',
|
|
218
218
|
maxHeight: 180,
|
|
219
|
-
backgroundColor:
|
|
219
|
+
backgroundColor: AppColors.slate50,
|
|
220
220
|
borderRadius: 8,
|
|
221
221
|
borderWidth: 1,
|
|
222
|
-
borderColor:
|
|
222
|
+
borderColor: AppColors.slate200,
|
|
223
223
|
padding: 10,
|
|
224
224
|
marginBottom: 20,
|
|
225
225
|
},
|
|
@@ -229,7 +229,7 @@ const styles = StyleSheet.create({
|
|
|
229
229
|
code: {
|
|
230
230
|
fontFamily: monoFont,
|
|
231
231
|
fontSize: 11,
|
|
232
|
-
color:
|
|
232
|
+
color: AppColors.rose600,
|
|
233
233
|
},
|
|
234
234
|
btnRow: {
|
|
235
235
|
flexDirection: 'row',
|
|
@@ -238,7 +238,7 @@ const styles = StyleSheet.create({
|
|
|
238
238
|
},
|
|
239
239
|
resetBtn: {
|
|
240
240
|
flex: 1,
|
|
241
|
-
backgroundColor: AppColors.purple
|
|
241
|
+
backgroundColor: AppColors.purple,
|
|
242
242
|
height: 40,
|
|
243
243
|
borderRadius: 8,
|
|
244
244
|
justifyContent: 'center',
|
|
@@ -247,13 +247,13 @@ const styles = StyleSheet.create({
|
|
|
247
247
|
resetBtnText: {
|
|
248
248
|
fontFamily: AppFonts.interBold || 'System',
|
|
249
249
|
fontSize: 13,
|
|
250
|
-
color:
|
|
250
|
+
color: AppColors.white,
|
|
251
251
|
},
|
|
252
252
|
closeBtn: {
|
|
253
253
|
flex: 1,
|
|
254
|
-
backgroundColor:
|
|
254
|
+
backgroundColor: AppColors.slate100,
|
|
255
255
|
borderWidth: 1,
|
|
256
|
-
borderColor:
|
|
256
|
+
borderColor: AppColors.slate200,
|
|
257
257
|
height: 40,
|
|
258
258
|
borderRadius: 8,
|
|
259
259
|
justifyContent: 'center',
|
|
@@ -262,13 +262,13 @@ const styles = StyleSheet.create({
|
|
|
262
262
|
closeBtnText: {
|
|
263
263
|
fontFamily: AppFonts.interBold || 'System',
|
|
264
264
|
fontSize: 13,
|
|
265
|
-
color:
|
|
265
|
+
color: AppColors.slate600,
|
|
266
266
|
},
|
|
267
267
|
inlineContainer: {
|
|
268
268
|
padding: 8,
|
|
269
|
-
backgroundColor:
|
|
269
|
+
backgroundColor: AppColors.roseBg,
|
|
270
270
|
borderWidth: 1,
|
|
271
|
-
borderColor:
|
|
271
|
+
borderColor: AppColors.errorBorder,
|
|
272
272
|
borderRadius: 8,
|
|
273
273
|
flexDirection: 'row',
|
|
274
274
|
alignItems: 'center',
|
|
@@ -278,10 +278,10 @@ const styles = StyleSheet.create({
|
|
|
278
278
|
inlineTitle: {
|
|
279
279
|
fontFamily: AppFonts.interBold || 'System',
|
|
280
280
|
fontSize: 11,
|
|
281
|
-
color:
|
|
281
|
+
color: AppColors.redErrorText,
|
|
282
282
|
},
|
|
283
283
|
inlineResetBtn: {
|
|
284
|
-
backgroundColor:
|
|
284
|
+
backgroundColor: AppColors.redErrorText,
|
|
285
285
|
paddingHorizontal: 10,
|
|
286
286
|
paddingVertical: 4,
|
|
287
287
|
borderRadius: 4,
|
|
@@ -289,7 +289,7 @@ const styles = StyleSheet.create({
|
|
|
289
289
|
inlineResetText: {
|
|
290
290
|
fontFamily: AppFonts.interBold || 'System',
|
|
291
291
|
fontSize: 10,
|
|
292
|
-
color:
|
|
292
|
+
color: AppColors.white,
|
|
293
293
|
},
|
|
294
294
|
});
|
|
295
295
|
export default ErrorBoundary;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Animated, PanResponder } from 'react-native';
|
|
3
|
+
interface FloatingBubbleProps {
|
|
4
|
+
pan: Animated.ValueXY;
|
|
5
|
+
panResponder: ReturnType<typeof PanResponder.create>;
|
|
6
|
+
fabScaleAnim: Animated.Value;
|
|
7
|
+
fabRotateAnim: Animated.Value;
|
|
8
|
+
fabShineAnim: Animated.Value;
|
|
9
|
+
unreadPulseAnim: Animated.Value;
|
|
10
|
+
hasUnread: boolean;
|
|
11
|
+
onPress: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const FloatingBubble: React.FC<FloatingBubbleProps>;
|
|
14
|
+
export default FloatingBubble;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Animated, View } from 'react-native';
|
|
3
|
+
import LinearGradient from 'react-native-linear-gradient';
|
|
4
|
+
import TouchableScale from './TouchableScale';
|
|
5
|
+
import { BrandCircleIcon } from './BrandCircleIcon';
|
|
6
|
+
import styles from '../styles';
|
|
7
|
+
import { AppColors } from '../styles/AppColors';
|
|
8
|
+
export const FloatingBubble = ({ pan, panResponder, fabScaleAnim, fabRotateAnim, fabShineAnim, unreadPulseAnim, hasUnread, onPress, }) => {
|
|
9
|
+
return (<Animated.View style={[
|
|
10
|
+
styles.fabContainer,
|
|
11
|
+
{
|
|
12
|
+
transform: [
|
|
13
|
+
{ translateX: pan.x },
|
|
14
|
+
{ translateY: pan.y },
|
|
15
|
+
{ scale: fabScaleAnim },
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
]} {...panResponder.panHandlers}>
|
|
19
|
+
<TouchableScale style={styles.fabGradientTouchable} onPress={onPress} activeScale={0.88}>
|
|
20
|
+
<LinearGradient colors={[
|
|
21
|
+
AppColors.gradientPurpleStart,
|
|
22
|
+
AppColors.gradientPurpleMid,
|
|
23
|
+
AppColors.gradientPurpleEnd,
|
|
24
|
+
]} start={{ x: 0, y: 0 }} end={{ x: 1, y: 1 }} style={styles.fabGradientInner}>
|
|
25
|
+
<Animated.View style={{
|
|
26
|
+
transform: [
|
|
27
|
+
{
|
|
28
|
+
rotate: fabRotateAnim.interpolate({
|
|
29
|
+
inputRange: [0, 1],
|
|
30
|
+
outputRange: ['0deg', '360deg'],
|
|
31
|
+
}),
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
}}>
|
|
35
|
+
<BrandCircleIcon size={38}/>
|
|
36
|
+
</Animated.View>
|
|
37
|
+
</LinearGradient>
|
|
38
|
+
|
|
39
|
+
<View pointerEvents="none" style={styles.fabShineClip}>
|
|
40
|
+
<Animated.View style={[
|
|
41
|
+
styles.fabShineStreak,
|
|
42
|
+
{
|
|
43
|
+
transform: [
|
|
44
|
+
{
|
|
45
|
+
translateX: fabShineAnim.interpolate({
|
|
46
|
+
inputRange: [0, 1],
|
|
47
|
+
outputRange: [-48, 96],
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
50
|
+
{ rotate: '25deg' },
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
]}>
|
|
54
|
+
<LinearGradient colors={[
|
|
55
|
+
'rgba(255,255,255,0)',
|
|
56
|
+
'rgba(255,255,255,0.55)',
|
|
57
|
+
'rgba(255,255,255,0)',
|
|
58
|
+
]} start={{ x: 0, y: 0.5 }} end={{ x: 1, y: 0.5 }} style={{ flex: 1 }}/>
|
|
59
|
+
</Animated.View>
|
|
60
|
+
</View>
|
|
61
|
+
{hasUnread && (<Animated.View style={[
|
|
62
|
+
styles.fabGreenDot,
|
|
63
|
+
{ transform: [{ scale: unreadPulseAnim }] },
|
|
64
|
+
]}/>)}
|
|
65
|
+
</TouchableScale>
|
|
66
|
+
</Animated.View>);
|
|
67
|
+
};
|
|
68
|
+
export default FloatingBubble;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import { View, Pressable, Text, Animated } from 'react-native';
|
|
3
4
|
// Components
|
|
4
5
|
import CopyButton from './CopyButton';
|
|
@@ -58,6 +59,7 @@ const HeaderRow = React.memo(function HeaderRow({ headerKey, value, isLast, inde
|
|
|
58
59
|
</Animated.View>);
|
|
59
60
|
});
|
|
60
61
|
const HeadersSection = ({ title, headers, search, resetKey, }) => {
|
|
62
|
+
const { t } = useTranslation();
|
|
61
63
|
const { toggleOpen, forceOpen, chevronStyle, bodyStyle } = useAccordion(false, 2400, 300);
|
|
62
64
|
useEffect(() => {
|
|
63
65
|
forceOpen(false);
|
|
@@ -104,12 +106,12 @@ const HeadersSection = ({ title, headers, search, resetKey, }) => {
|
|
|
104
106
|
|
|
105
107
|
<Animated.View style={bodyStyle}>
|
|
106
108
|
<View style={styles.htColHeadRow}>
|
|
107
|
-
<Text style={[styles.htColHead, { width: '30%' }]}>
|
|
108
|
-
<Text style={[styles.htColHead, { flex: 1 }]}>
|
|
109
|
+
<Text style={[styles.htColHead, { width: '30%' }]}>{t('network.jsonViewer.key')}</Text>
|
|
110
|
+
<Text style={[styles.htColHead, { flex: 1 }]}>{t('network.jsonViewer.value')}</Text>
|
|
109
111
|
</View>
|
|
110
112
|
|
|
111
113
|
{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}>
|
|
114
|
+
<Text style={styles.htEmptyText}>{t('network.noMatchingHeaders')}</Text>
|
|
113
115
|
</View>)}
|
|
114
116
|
</Animated.View>
|
|
115
117
|
</View>);
|
|
@@ -2,9 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Text } from 'react-native';
|
|
3
3
|
// Helpers
|
|
4
4
|
import { escapeRegex, handleOpenExternalLink } from '../helpers';
|
|
5
|
-
const HighlightText = ({ text, search, style, highlightStyle, detectLinks, ...rest })
|
|
6
|
-
const hasNumberOfLines = 'numberOfLines' in rest;
|
|
7
|
-
const numLines = hasNumberOfLines ? rest.numberOfLines : 1;
|
|
5
|
+
const HighlightText = React.memo(function HighlightText({ text, search, style, highlightStyle, detectLinks, numberOfLines, ...rest }) {
|
|
8
6
|
// Regex to detect absolute URLs
|
|
9
7
|
const URL_REGEX = /(https?:\/\/[^\s]+)/g;
|
|
10
8
|
const renderNormalOrHighlighted = (subText, keyPrefix) => {
|
|
@@ -21,7 +19,7 @@ const HighlightText = ({ text, search, style, highlightStyle, detectLinks, ...re
|
|
|
21
19
|
};
|
|
22
20
|
if (detectLinks && text) {
|
|
23
21
|
const parts = text.split(URL_REGEX);
|
|
24
|
-
return (<Text style={style} numberOfLines={
|
|
22
|
+
return (<Text style={style} numberOfLines={numberOfLines} {...rest}>
|
|
25
23
|
{parts.map((part, i) => {
|
|
26
24
|
if (part.match(URL_REGEX)) {
|
|
27
25
|
return (<Text key={`link-${i}`} style={{
|
|
@@ -38,15 +36,15 @@ const HighlightText = ({ text, search, style, highlightStyle, detectLinks, ...re
|
|
|
38
36
|
</Text>);
|
|
39
37
|
}
|
|
40
38
|
if (!search)
|
|
41
|
-
return (<Text style={style} numberOfLines={
|
|
39
|
+
return (<Text style={style} numberOfLines={numberOfLines} {...rest}>
|
|
42
40
|
{text}
|
|
43
41
|
</Text>);
|
|
44
42
|
const regex = new RegExp(`(${escapeRegex(search)})`, 'gi');
|
|
45
43
|
const parts = text.split(regex);
|
|
46
|
-
return (<Text style={style} numberOfLines={
|
|
44
|
+
return (<Text style={style} numberOfLines={numberOfLines} {...rest}>
|
|
47
45
|
{parts.map((part, i) => part.toLowerCase() === search.toLowerCase() ? (<Text key={i} style={highlightStyle}>
|
|
48
46
|
{part}
|
|
49
47
|
</Text>) : (<Text key={i}>{part}</Text>))}
|
|
50
48
|
</Text>);
|
|
51
|
-
};
|
|
49
|
+
});
|
|
52
50
|
export default HighlightText;
|