react-native-inapp-inspector 2.3.18 → 2.3.20
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/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +57 -0
- package/dist/commonjs/analytics.js +1 -24
- package/dist/commonjs/bundle.js +1 -16
- package/dist/commonjs/capture.d.ts +2 -0
- package/dist/commonjs/capture.js +1 -32
- package/dist/commonjs/components/AnalyticsDetail.js +92 -623
- package/dist/commonjs/components/AnalyticsEventCard.js +54 -350
- package/dist/commonjs/components/AnalyticsGraph.js +70 -370
- package/dist/commonjs/components/AnimatedEntrance.js +1 -11
- package/dist/commonjs/components/AppHeaderLogo.js +7 -134
- package/dist/commonjs/components/BrandCircleIcon.js +73 -118
- package/dist/commonjs/components/BrandSquareIcon.js +63 -108
- package/dist/commonjs/components/CodeSnippet.js +48 -623
- package/dist/commonjs/components/ConsoleLogCard.js +63 -537
- package/dist/commonjs/components/CopyButton.js +3 -89
- package/dist/commonjs/components/DiffViewer.js +19 -83
- package/dist/commonjs/components/DomainHeader.js +27 -127
- package/dist/commonjs/components/EmptyState.d.ts +1 -0
- package/dist/commonjs/components/EmptyState.js +10 -87
- package/dist/commonjs/components/EndOfListFooter.js +7 -81
- package/dist/commonjs/components/ErrorBoundary.js +72 -566
- package/dist/commonjs/components/HeadersSection.js +31 -110
- package/dist/commonjs/components/HighlightText.js +17 -58
- package/dist/commonjs/components/Inspector/AboutModal.d.ts +6 -0
- package/dist/commonjs/components/Inspector/AboutModal.js +351 -0
- package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +98 -797
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +284 -930
- package/dist/commonjs/components/Inspector/BundleTab.js +551 -2918
- package/dist/commonjs/components/Inspector/ConsoleTab.js +79 -492
- package/dist/commonjs/components/Inspector/CrashDetail.js +123 -672
- package/dist/commonjs/components/Inspector/CrashFilterModal.js +66 -498
- package/dist/commonjs/components/Inspector/CrashTab.js +98 -670
- package/dist/commonjs/components/Inspector/DebuggingTab.js +64 -871
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +143 -907
- package/dist/commonjs/components/Inspector/FabLauncher.js +85 -54
- package/dist/commonjs/components/Inspector/FeatureUnderDevNotice.js +6 -99
- package/dist/commonjs/components/Inspector/FeedbackModal.d.ts +9 -0
- package/dist/commonjs/components/Inspector/FeedbackModal.js +167 -521
- package/dist/commonjs/components/Inspector/InspectorContext.js +1 -21
- package/dist/commonjs/components/Inspector/InspectorHeader.js +219 -1093
- package/dist/commonjs/components/Inspector/LogDetail.js +168 -994
- package/dist/commonjs/components/Inspector/MainScreen.js +60 -332
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +136 -278
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +134 -361
- package/dist/commonjs/components/Inspector/NavigationTracker.js +1 -12
- package/dist/commonjs/components/Inspector/NetworkDetail.js +96 -432
- package/dist/commonjs/components/Inspector/NetworkFilterModal.js +60 -576
- package/dist/commonjs/components/Inspector/NetworkTab.js +84 -514
- package/dist/commonjs/components/Inspector/NpmStarPrompt.js +17 -433
- package/dist/commonjs/components/Inspector/NpmUpdateToast.js +25 -298
- package/dist/commonjs/components/Inspector/PerformanceTab.js +182 -1397
- package/dist/commonjs/components/Inspector/ReduxDetail.js +188 -1089
- package/dist/commonjs/components/Inspector/ReduxTab.js +85 -701
- package/dist/commonjs/components/Inspector/SettingsPanel.js +431 -3431
- package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +11 -180
- package/dist/commonjs/components/Inspector/StorageTab.js +93 -826
- package/dist/commonjs/components/Inspector/TabBar.js +47 -183
- package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +34 -408
- package/dist/commonjs/components/JsonViewer.js +168 -380
- package/dist/commonjs/components/LogCard.js +57 -567
- package/dist/commonjs/components/LogSyntaxHighlighter.js +11 -130
- package/dist/commonjs/components/MetaAccordion.js +69 -238
- package/dist/commonjs/components/MiniBarChart.js +3 -56
- package/dist/commonjs/components/MiniLineChart.js +3 -58
- package/dist/commonjs/components/NetworkIcons.d.ts +7 -0
- package/dist/commonjs/components/NetworkIcons.js +479 -997
- package/dist/commonjs/components/QRCodeView.js +5 -79
- package/dist/commonjs/components/SectionHeader.js +15 -37
- package/dist/commonjs/components/SegmentedTabs.js +7 -61
- package/dist/commonjs/components/SkeletonPlaceholder.js +11 -180
- package/dist/commonjs/components/Slider.js +15 -243
- package/dist/commonjs/components/SourcePageCard.js +30 -89
- package/dist/commonjs/components/Toast.js +5 -147
- package/dist/commonjs/components/TouchableScale.js +3 -24
- package/dist/commonjs/components/TreeNode.js +55 -130
- package/dist/commonjs/console.js +1 -16
- package/dist/commonjs/constants/index.js +1 -32
- package/dist/commonjs/constants/telemetryConfig.js +1 -6
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -4
- package/dist/commonjs/crash.js +1 -23
- package/dist/commonjs/customHooks/analyticsLogger.js +1 -250
- package/dist/commonjs/customHooks/bundleAnalyzer.js +1 -957
- package/dist/commonjs/customHooks/consoleLogger.js +6 -445
- package/dist/commonjs/customHooks/crashHandler.js +7 -656
- package/dist/commonjs/customHooks/logFilters.js +1 -23
- package/dist/commonjs/customHooks/networkLogger.js +2 -536
- package/dist/commonjs/customHooks/performanceTracker.js +63 -750
- package/dist/commonjs/customHooks/reduxLogger.js +2 -313
- package/dist/commonjs/customHooks/storageInspector.js +1 -435
- package/dist/commonjs/customHooks/useAccordion.js +1 -18
- package/dist/commonjs/decorators/index.js +1 -100
- package/dist/commonjs/helpers/gaAnalyticsRegistry.js +1 -148
- package/dist/commonjs/helpers/index.js +8 -921
- package/dist/commonjs/helpers/memoryManager.js +1 -99
- package/dist/commonjs/helpers/qrGenerator.js +1 -367
- package/dist/commonjs/helpers/remoteConfig.js +1 -165
- package/dist/commonjs/helpers/searchQueryParser.js +1 -62
- package/dist/commonjs/helpers/settingsStore.js +1 -144
- package/dist/commonjs/helpers/telemetry.js +1 -501
- package/dist/commonjs/helpers/toast.js +1 -20
- package/dist/commonjs/i18n/index.js +1 -90
- package/dist/commonjs/i18n/locales/en.json +1 -1122
- package/dist/commonjs/index.js +5 -2153
- package/dist/commonjs/metro.js +6 -468
- package/dist/commonjs/native/NativeInspector.d.ts +3 -0
- package/dist/commonjs/native/NativeInspector.js +1 -402
- package/dist/commonjs/native/NativeNetworkInspector.d.ts +1 -0
- package/dist/commonjs/native/NativeNetworkInspector.js +1 -4
- package/dist/commonjs/network.js +1 -13
- package/dist/commonjs/performance.js +1 -29
- package/dist/commonjs/redux.js +1 -20
- package/dist/commonjs/storage.js +1 -14
- package/dist/commonjs/styles/AppColors.js +1 -423
- package/dist/commonjs/styles/AppFonts.js +1 -17
- package/dist/commonjs/styles/common.js +1 -190
- package/dist/commonjs/styles/index.d.ts +6 -0
- package/dist/commonjs/styles/index.js +1 -1589
- package/dist/commonjs/types/enums.d.ts +2 -1
- package/dist/commonjs/types/enums.js +1 -150
- package/dist/commonjs/types/index.js +1 -18
- package/dist/commonjs/types/interfaces.d.ts +7 -0
- package/dist/commonjs/types/interfaces.js +1 -2
- package/dist/esm/analytics.js +1 -2
- package/dist/esm/bundle.js +1 -2
- package/dist/esm/capture.d.ts +2 -0
- package/dist/esm/capture.js +1 -29
- package/dist/esm/components/AnalyticsDetail.js +171 -664
- package/dist/esm/components/AnalyticsEventCard.js +77 -335
- package/dist/esm/components/AnalyticsGraph.js +95 -357
- package/dist/esm/components/AnimatedEntrance.js +1 -6
- package/dist/esm/components/AppHeaderLogo.js +7 -94
- package/dist/esm/components/BrandCircleIcon.js +114 -119
- package/dist/esm/components/BrandSquareIcon.js +73 -78
- package/dist/esm/components/CodeSnippet.js +58 -595
- package/dist/esm/components/ConsoleLogCard.js +91 -526
- package/dist/esm/components/CopyButton.js +3 -51
- package/dist/esm/components/DiffViewer.js +22 -48
- package/dist/esm/components/DomainHeader.js +43 -138
- package/dist/esm/components/EmptyState.d.ts +1 -0
- package/dist/esm/components/EmptyState.js +17 -56
- package/dist/esm/components/EndOfListFooter.js +15 -83
- package/dist/esm/components/ErrorBoundary.js +125 -582
- package/dist/esm/components/HeadersSection.js +52 -93
- package/dist/esm/components/HighlightText.js +17 -53
- package/dist/esm/components/Inspector/AboutModal.d.ts +6 -0
- package/dist/esm/components/Inspector/AboutModal.js +351 -0
- package/dist/esm/components/Inspector/AnalyticsFilterModal.js +225 -886
- package/dist/esm/components/Inspector/AnalyticsTab.js +296 -904
- package/dist/esm/components/Inspector/BundleTab.js +1175 -3502
- package/dist/esm/components/Inspector/ConsoleTab.js +113 -488
- package/dist/esm/components/Inspector/CrashDetail.js +236 -747
- package/dist/esm/components/Inspector/CrashFilterModal.js +149 -541
- package/dist/esm/components/Inspector/CrashTab.js +177 -711
- package/dist/esm/components/Inspector/DebuggingTab.js +156 -923
- package/dist/esm/components/Inspector/DeviceInfoTab.js +199 -924
- package/dist/esm/components/Inspector/FabLauncher.js +85 -49
- package/dist/esm/components/Inspector/FeatureUnderDevNotice.js +14 -70
- package/dist/esm/components/Inspector/FeedbackModal.d.ts +9 -0
- package/dist/esm/components/Inspector/FeedbackModal.js +182 -499
- package/dist/esm/components/Inspector/InspectorContext.js +1 -12
- package/dist/esm/components/Inspector/InspectorHeader.js +309 -1145
- package/dist/esm/components/Inspector/LogDetail.js +235 -1023
- package/dist/esm/components/Inspector/MainScreen.js +86 -320
- package/dist/esm/components/Inspector/MediaGalleryTab.js +157 -259
- package/dist/esm/components/Inspector/MediaPreviewModal.js +153 -340
- package/dist/esm/components/Inspector/NavigationTracker.js +1 -10
- package/dist/esm/components/Inspector/NetworkDetail.js +141 -472
- package/dist/esm/components/Inspector/NetworkFilterModal.js +122 -597
- package/dist/esm/components/Inspector/NetworkTab.js +125 -517
- package/dist/esm/components/Inspector/NpmStarPrompt.js +58 -434
- package/dist/esm/components/Inspector/NpmUpdateToast.js +45 -281
- package/dist/esm/components/Inspector/PerformanceTab.js +393 -1570
- package/dist/esm/components/Inspector/ReduxDetail.js +307 -1170
- package/dist/esm/components/Inspector/ReduxTab.js +144 -722
- package/dist/esm/components/Inspector/SettingsPanel.js +647 -3609
- package/dist/esm/components/Inspector/SkeletonPlaceholder.js +30 -163
- package/dist/esm/components/Inspector/StorageTab.js +172 -866
- package/dist/esm/components/Inspector/TabBar.js +52 -183
- package/dist/esm/components/Inspector/UpdateAvailableModal.js +79 -416
- package/dist/esm/components/JsonViewer.js +179 -353
- package/dist/esm/components/LogCard.js +93 -565
- package/dist/esm/components/LogSyntaxHighlighter.js +11 -123
- package/dist/esm/components/MetaAccordion.js +136 -267
- package/dist/esm/components/MiniBarChart.js +3 -18
- package/dist/esm/components/MiniLineChart.js +3 -20
- package/dist/esm/components/NetworkIcons.d.ts +7 -0
- package/dist/esm/components/NetworkIcons.js +481 -817
- package/dist/esm/components/QRCodeView.js +8 -45
- package/dist/esm/components/SectionHeader.js +22 -39
- package/dist/esm/components/SegmentedTabs.js +8 -57
- package/dist/esm/components/SkeletonPlaceholder.js +30 -163
- package/dist/esm/components/Slider.js +24 -213
- package/dist/esm/components/SourcePageCard.js +65 -86
- package/dist/esm/components/Toast.js +10 -117
- package/dist/esm/components/TouchableScale.js +3 -19
- package/dist/esm/components/TreeNode.js +58 -95
- package/dist/esm/console.js +1 -2
- package/dist/esm/constants/index.js +1 -28
- package/dist/esm/constants/telemetryConfig.js +1 -3
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/crash.js +1 -2
- package/dist/esm/customHooks/analyticsLogger.js +1 -230
- package/dist/esm/customHooks/bundleAnalyzer.js +1 -944
- package/dist/esm/customHooks/consoleLogger.js +6 -432
- package/dist/esm/customHooks/crashHandler.js +7 -630
- package/dist/esm/customHooks/logFilters.js +1 -20
- package/dist/esm/customHooks/networkLogger.js +2 -519
- package/dist/esm/customHooks/performanceTracker.js +63 -723
- package/dist/esm/customHooks/reduxLogger.js +2 -293
- package/dist/esm/customHooks/storageInspector.js +1 -418
- package/dist/esm/customHooks/useAccordion.js +1 -16
- package/dist/esm/decorators/index.js +1 -95
- package/dist/esm/helpers/gaAnalyticsRegistry.js +1 -143
- package/dist/esm/helpers/index.js +8 -861
- package/dist/esm/helpers/memoryManager.js +1 -91
- package/dist/esm/helpers/qrGenerator.js +1 -364
- package/dist/esm/helpers/remoteConfig.js +1 -160
- package/dist/esm/helpers/searchQueryParser.js +1 -59
- package/dist/esm/helpers/settingsStore.js +1 -134
- package/dist/esm/helpers/telemetry.js +1 -489
- package/dist/esm/helpers/toast.js +1 -15
- package/dist/esm/i18n/index.js +1 -78
- package/dist/esm/i18n/locales/en.json +1 -1122
- package/dist/esm/index.js +7 -1967
- package/dist/esm/metro.js +6 -459
- package/dist/esm/native/NativeInspector.d.ts +3 -0
- package/dist/esm/native/NativeInspector.js +1 -370
- package/dist/esm/native/NativeNetworkInspector.d.ts +1 -0
- package/dist/esm/native/NativeNetworkInspector.js +1 -2
- package/dist/esm/network.js +1 -1
- package/dist/esm/performance.js +1 -2
- package/dist/esm/redux.js +1 -1
- package/dist/esm/storage.js +1 -1
- package/dist/esm/styles/AppColors.js +1 -417
- package/dist/esm/styles/AppFonts.js +1 -13
- package/dist/esm/styles/common.js +1 -186
- package/dist/esm/styles/index.d.ts +6 -0
- package/dist/esm/styles/index.js +1 -1551
- package/dist/esm/types/enums.d.ts +2 -1
- package/dist/esm/types/enums.js +1 -147
- package/dist/esm/types/index.js +1 -2
- package/dist/esm/types/interfaces.d.ts +7 -0
- package/dist/esm/types/interfaces.js +1 -1
- package/ios/NetworkInspectorModule.mm +253 -136
- package/package.json +5 -3
- package/react-native-inapp-inspector.podspec +1 -1
- package/src/native/NativeInspector.ts +17 -0
- package/src/native/NativeNetworkInspector.ts +1 -0
- package/src/analytics.ts +0 -35
- package/src/bundle.ts +0 -25
- package/src/capture.ts +0 -101
- package/src/components/AnalyticsDetail.tsx +0 -870
- package/src/components/AnalyticsEventCard.tsx +0 -444
- package/src/components/AnalyticsGraph.tsx +0 -583
- package/src/components/AnimatedEntrance.tsx +0 -20
- package/src/components/AppHeaderLogo.tsx +0 -143
- package/src/components/BrandCircleIcon.tsx +0 -144
- package/src/components/BrandSquareIcon.tsx +0 -184
- package/src/components/CodeSnippet.tsx +0 -725
- package/src/components/ConsoleLogCard.tsx +0 -679
- package/src/components/CopyButton.tsx +0 -87
- package/src/components/DiffViewer.tsx +0 -82
- package/src/components/DomainHeader.tsx +0 -224
- package/src/components/EmptyState.tsx +0 -95
- package/src/components/EndOfListFooter.tsx +0 -100
- package/src/components/ErrorBoundary.tsx +0 -688
- package/src/components/HeadersSection.tsx +0 -172
- package/src/components/HighlightText.tsx +0 -100
- package/src/components/Inspector/AnalyticsFilterModal.tsx +0 -1250
- package/src/components/Inspector/AnalyticsTab.tsx +0 -1362
- package/src/components/Inspector/BundleTab.tsx +0 -4768
- package/src/components/Inspector/ConsoleTab.tsx +0 -726
- package/src/components/Inspector/CrashDetail.tsx +0 -997
- package/src/components/Inspector/CrashFilterModal.tsx +0 -721
- package/src/components/Inspector/CrashTab.tsx +0 -933
- package/src/components/Inspector/DebuggingTab.tsx +0 -1103
- package/src/components/Inspector/DeviceInfoTab.tsx +0 -1397
- package/src/components/Inspector/FabLauncher.tsx +0 -80
- package/src/components/Inspector/FeatureUnderDevNotice.tsx +0 -94
- package/src/components/Inspector/FeedbackModal.tsx +0 -626
- package/src/components/Inspector/InspectorContext.tsx +0 -28
- package/src/components/Inspector/InspectorHeader.tsx +0 -1545
- package/src/components/Inspector/LogDetail.tsx +0 -1431
- package/src/components/Inspector/MainScreen.tsx +0 -459
- package/src/components/Inspector/MediaGalleryTab.tsx +0 -355
- package/src/components/Inspector/MediaPreviewModal.tsx +0 -435
- package/src/components/Inspector/NavigationTracker.tsx +0 -13
- package/src/components/Inspector/NetworkDetail.tsx +0 -795
- package/src/components/Inspector/NetworkFilterModal.tsx +0 -730
- package/src/components/Inspector/NetworkTab.tsx +0 -820
- package/src/components/Inspector/NpmStarPrompt.tsx +0 -532
- package/src/components/Inspector/NpmUpdateToast.tsx +0 -387
- package/src/components/Inspector/PerformanceTab.tsx +0 -1967
- package/src/components/Inspector/ReduxDetail.tsx +0 -1651
- package/src/components/Inspector/ReduxTab.tsx +0 -987
- package/src/components/Inspector/SettingsPanel.tsx +0 -4580
- package/src/components/Inspector/SkeletonPlaceholder.tsx +0 -206
- package/src/components/Inspector/StorageTab.tsx +0 -1159
- package/src/components/Inspector/TabBar.tsx +0 -263
- package/src/components/Inspector/UpdateAvailableModal.tsx +0 -555
- package/src/components/JsonViewer.tsx +0 -547
- package/src/components/LogCard.tsx +0 -694
- package/src/components/LogSyntaxHighlighter.tsx +0 -178
- package/src/components/MetaAccordion.tsx +0 -355
- package/src/components/MiniBarChart.tsx +0 -42
- package/src/components/MiniLineChart.tsx +0 -33
- package/src/components/NetworkIcons.tsx +0 -2599
- package/src/components/QRCodeView.tsx +0 -75
- package/src/components/SectionHeader.tsx +0 -101
- package/src/components/SegmentedTabs.tsx +0 -83
- package/src/components/SkeletonPlaceholder.tsx +0 -206
- package/src/components/Slider.tsx +0 -300
- package/src/components/SourcePageCard.tsx +0 -150
- package/src/components/Toast.tsx +0 -131
- package/src/components/TouchableScale.tsx +0 -61
- package/src/components/TreeNode.tsx +0 -171
- package/src/console.ts +0 -24
- package/src/constants/index.ts +0 -41
- package/src/constants/telemetryConfig.ts +0 -4
- package/src/constants/version.ts +0 -3
- package/src/crash.ts +0 -32
- package/src/customHooks/analyticsLogger.ts +0 -336
- package/src/customHooks/bundleAnalyzer.ts +0 -1256
- package/src/customHooks/consoleLogger.ts +0 -530
- package/src/customHooks/crashHandler.ts +0 -944
- package/src/customHooks/logFilters.ts +0 -32
- package/src/customHooks/networkLogger.ts +0 -624
- package/src/customHooks/performanceTracker.ts +0 -1014
- package/src/customHooks/reduxLogger.ts +0 -406
- package/src/customHooks/storageInspector.ts +0 -513
- package/src/customHooks/useAccordion.tsx +0 -27
- package/src/decorators/index.ts +0 -184
- package/src/helpers/gaAnalyticsRegistry.ts +0 -204
- package/src/helpers/index.ts +0 -1092
- package/src/helpers/memoryManager.ts +0 -138
- package/src/helpers/qrGenerator.ts +0 -430
- package/src/helpers/remoteConfig.ts +0 -212
- package/src/helpers/searchQueryParser.ts +0 -84
- package/src/helpers/settingsStore.ts +0 -171
- package/src/helpers/telemetry.ts +0 -568
- package/src/helpers/toast.ts +0 -17
- package/src/i18n/index.ts +0 -104
- package/src/i18n/locales/en.json +0 -1125
- package/src/index.tsx +0 -2635
- package/src/metro.ts +0 -598
- package/src/network.ts +0 -22
- package/src/performance.ts +0 -38
- package/src/redux.ts +0 -23
- package/src/storage.ts +0 -18
- package/src/styles/AppColors.ts +0 -455
- package/src/styles/AppFonts.ts +0 -26
- package/src/styles/common.ts +0 -209
- package/src/styles/index.ts +0 -1606
- package/src/types/enums.ts +0 -208
- package/src/types/index.ts +0 -34
- package/src/types/interfaces.ts +0 -530
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
import React, {useRef, useState, useCallback, useMemo} from 'react';
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
Text,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
PanResponder,
|
|
7
|
-
LayoutChangeEvent,
|
|
8
|
-
GestureResponderEvent,
|
|
9
|
-
PanResponderGestureState,
|
|
10
|
-
} from 'react-native';
|
|
11
|
-
import {AppColors} from '../styles/AppColors';
|
|
12
|
-
import {AppFonts} from '../styles/AppFonts';
|
|
13
|
-
import TouchableScale from './TouchableScale';
|
|
14
|
-
|
|
15
|
-
export interface SliderProps {
|
|
16
|
-
value: number;
|
|
17
|
-
onValueChange: (value: number) => void;
|
|
18
|
-
min?: number;
|
|
19
|
-
max?: number;
|
|
20
|
-
step?: number;
|
|
21
|
-
formatLabel?: (value: number) => string;
|
|
22
|
-
quickPresets?: number[];
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export const Slider: React.FC<SliderProps> = React.memo(
|
|
27
|
-
({
|
|
28
|
-
value,
|
|
29
|
-
onValueChange,
|
|
30
|
-
min = 50,
|
|
31
|
-
max = 90,
|
|
32
|
-
step = 5,
|
|
33
|
-
formatLabel = val => `${Math.round(val)}%`,
|
|
34
|
-
quickPresets = [50, 60, 70, 80, 90],
|
|
35
|
-
disabled = false,
|
|
36
|
-
}) => {
|
|
37
|
-
const trackWidthRef = useRef<number>(0);
|
|
38
|
-
const [trackWidth, setTrackWidth] = useState<number>(0);
|
|
39
|
-
const [isDragging, setIsDragging] = useState<boolean>(false);
|
|
40
|
-
|
|
41
|
-
const clampedValue = Math.max(min, Math.min(max, value));
|
|
42
|
-
const percentage = (clampedValue - min) / (max - min || 1);
|
|
43
|
-
|
|
44
|
-
const updateValueFromPosition = useCallback(
|
|
45
|
-
(pageX: number, trackPageX: number) => {
|
|
46
|
-
if (trackWidthRef.current <= 0) return;
|
|
47
|
-
const relativeX = Math.max(
|
|
48
|
-
0,
|
|
49
|
-
Math.min(trackWidthRef.current, pageX - trackPageX),
|
|
50
|
-
);
|
|
51
|
-
const rawRatio = relativeX / trackWidthRef.current;
|
|
52
|
-
let newValue = min + rawRatio * (max - min);
|
|
53
|
-
|
|
54
|
-
if (step > 0) {
|
|
55
|
-
newValue = Math.round(newValue / step) * step;
|
|
56
|
-
}
|
|
57
|
-
newValue = Math.max(min, Math.min(max, newValue));
|
|
58
|
-
onValueChange(newValue);
|
|
59
|
-
},
|
|
60
|
-
[min, max, step, onValueChange],
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
const trackContainerRef = useRef<View>(null);
|
|
64
|
-
const trackPageXRef = useRef<number>(0);
|
|
65
|
-
|
|
66
|
-
const measureTrack = useCallback(() => {
|
|
67
|
-
if (trackContainerRef.current) {
|
|
68
|
-
trackContainerRef.current.measure((_x, _y, _width, _height, pageX) => {
|
|
69
|
-
trackPageXRef.current = pageX;
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}, []);
|
|
73
|
-
|
|
74
|
-
const panResponder = useMemo(
|
|
75
|
-
() =>
|
|
76
|
-
PanResponder.create({
|
|
77
|
-
onStartShouldSetPanResponder: () => !disabled,
|
|
78
|
-
onMoveShouldSetPanResponder: () => !disabled,
|
|
79
|
-
onPanResponderGrant: (evt: GestureResponderEvent) => {
|
|
80
|
-
setIsDragging(true);
|
|
81
|
-
measureTrack();
|
|
82
|
-
updateValueFromPosition(evt.nativeEvent.pageX, trackPageXRef.current);
|
|
83
|
-
},
|
|
84
|
-
onPanResponderMove: (
|
|
85
|
-
evt: GestureResponderEvent,
|
|
86
|
-
_gestureState: PanResponderGestureState,
|
|
87
|
-
) => {
|
|
88
|
-
updateValueFromPosition(evt.nativeEvent.pageX, trackPageXRef.current);
|
|
89
|
-
},
|
|
90
|
-
onPanResponderRelease: () => {
|
|
91
|
-
setIsDragging(false);
|
|
92
|
-
},
|
|
93
|
-
onPanResponderTerminate: () => {
|
|
94
|
-
setIsDragging(false);
|
|
95
|
-
},
|
|
96
|
-
}),
|
|
97
|
-
[disabled, measureTrack, updateValueFromPosition],
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
const handleLayout = (e: LayoutChangeEvent) => {
|
|
101
|
-
const w = e.nativeEvent.layout.width;
|
|
102
|
-
trackWidthRef.current = w;
|
|
103
|
-
setTrackWidth(w);
|
|
104
|
-
measureTrack();
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
const thumbPosition = percentage * (trackWidth || 0);
|
|
108
|
-
|
|
109
|
-
return (
|
|
110
|
-
<View style={styles.container}>
|
|
111
|
-
{/* Value Display Row */}
|
|
112
|
-
<View style={styles.valueRow}>
|
|
113
|
-
<Text style={styles.rangeText}>{min}%</Text>
|
|
114
|
-
<View
|
|
115
|
-
style={[
|
|
116
|
-
styles.currentValueBadge,
|
|
117
|
-
isDragging && styles.currentValueBadgeActive,
|
|
118
|
-
]}>
|
|
119
|
-
<Text style={styles.currentValueText}>{formatLabel(clampedValue)}</Text>
|
|
120
|
-
</View>
|
|
121
|
-
<Text style={styles.rangeText}>{max}%</Text>
|
|
122
|
-
</View>
|
|
123
|
-
|
|
124
|
-
{/* Interactive Track Area */}
|
|
125
|
-
<View
|
|
126
|
-
ref={trackContainerRef}
|
|
127
|
-
onLayout={handleLayout}
|
|
128
|
-
{...panResponder.panHandlers}
|
|
129
|
-
style={styles.touchArea}>
|
|
130
|
-
{/* Background Rail */}
|
|
131
|
-
<View style={styles.rail}>
|
|
132
|
-
{/* Active Filled Bar */}
|
|
133
|
-
<View
|
|
134
|
-
style={[
|
|
135
|
-
styles.fillBar,
|
|
136
|
-
{width: `${Math.round(percentage * 100)}%`},
|
|
137
|
-
]}
|
|
138
|
-
/>
|
|
139
|
-
</View>
|
|
140
|
-
|
|
141
|
-
{/* Draggable Thumb */}
|
|
142
|
-
<View
|
|
143
|
-
style={[
|
|
144
|
-
styles.thumb,
|
|
145
|
-
{
|
|
146
|
-
left: Math.max(
|
|
147
|
-
0,
|
|
148
|
-
Math.min(
|
|
149
|
-
(trackWidth || 0) - 24,
|
|
150
|
-
thumbPosition - 12,
|
|
151
|
-
),
|
|
152
|
-
),
|
|
153
|
-
},
|
|
154
|
-
isDragging && styles.thumbActive,
|
|
155
|
-
]}>
|
|
156
|
-
<View style={styles.thumbCenterDot} />
|
|
157
|
-
</View>
|
|
158
|
-
</View>
|
|
159
|
-
|
|
160
|
-
{/* Quick Presets */}
|
|
161
|
-
{quickPresets && quickPresets.length > 0 && (
|
|
162
|
-
<View style={styles.presetRow}>
|
|
163
|
-
{quickPresets.map(preset => {
|
|
164
|
-
const isSelected = Math.round(clampedValue) === preset;
|
|
165
|
-
return (
|
|
166
|
-
<TouchableScale
|
|
167
|
-
key={preset}
|
|
168
|
-
onPress={() => onValueChange(preset)}
|
|
169
|
-
style={[
|
|
170
|
-
styles.presetButton,
|
|
171
|
-
isSelected && styles.presetButtonActive,
|
|
172
|
-
]}>
|
|
173
|
-
<Text
|
|
174
|
-
style={[
|
|
175
|
-
styles.presetText,
|
|
176
|
-
isSelected && styles.presetTextActive,
|
|
177
|
-
]}>
|
|
178
|
-
{preset}%
|
|
179
|
-
</Text>
|
|
180
|
-
</TouchableScale>
|
|
181
|
-
);
|
|
182
|
-
})}
|
|
183
|
-
</View>
|
|
184
|
-
)}
|
|
185
|
-
</View>
|
|
186
|
-
);
|
|
187
|
-
},
|
|
188
|
-
);
|
|
189
|
-
|
|
190
|
-
const styles = StyleSheet.create({
|
|
191
|
-
container: {
|
|
192
|
-
paddingVertical: 4,
|
|
193
|
-
gap: 8,
|
|
194
|
-
},
|
|
195
|
-
valueRow: {
|
|
196
|
-
flexDirection: 'row',
|
|
197
|
-
alignItems: 'center',
|
|
198
|
-
justifyContent: 'space-between',
|
|
199
|
-
paddingHorizontal: 2,
|
|
200
|
-
},
|
|
201
|
-
rangeText: {
|
|
202
|
-
fontFamily: AppFonts.interMedium,
|
|
203
|
-
fontSize: 11,
|
|
204
|
-
color: AppColors.grayText,
|
|
205
|
-
},
|
|
206
|
-
currentValueBadge: {
|
|
207
|
-
backgroundColor: `${AppColors.purple}1A`,
|
|
208
|
-
borderColor: `${AppColors.purple}33`,
|
|
209
|
-
borderWidth: 1,
|
|
210
|
-
borderRadius: 8,
|
|
211
|
-
paddingHorizontal: 10,
|
|
212
|
-
paddingVertical: 2.5,
|
|
213
|
-
},
|
|
214
|
-
currentValueBadgeActive: {
|
|
215
|
-
backgroundColor: AppColors.purple,
|
|
216
|
-
borderColor: AppColors.purple,
|
|
217
|
-
transform: [{scale: 1.05}],
|
|
218
|
-
},
|
|
219
|
-
currentValueText: {
|
|
220
|
-
fontFamily: AppFonts.interBold,
|
|
221
|
-
fontSize: 12,
|
|
222
|
-
color: AppColors.purple,
|
|
223
|
-
},
|
|
224
|
-
touchArea: {
|
|
225
|
-
height: 36,
|
|
226
|
-
justifyContent: 'center',
|
|
227
|
-
position: 'relative',
|
|
228
|
-
},
|
|
229
|
-
rail: {
|
|
230
|
-
height: 8,
|
|
231
|
-
backgroundColor: `${AppColors.grayTextWeak}2B`,
|
|
232
|
-
borderRadius: 4,
|
|
233
|
-
overflow: 'hidden',
|
|
234
|
-
position: 'relative',
|
|
235
|
-
},
|
|
236
|
-
fillBar: {
|
|
237
|
-
height: '100%',
|
|
238
|
-
backgroundColor: AppColors.purple,
|
|
239
|
-
borderRadius: 4,
|
|
240
|
-
},
|
|
241
|
-
thumb: {
|
|
242
|
-
position: 'absolute',
|
|
243
|
-
width: 24,
|
|
244
|
-
height: 24,
|
|
245
|
-
borderRadius: 12,
|
|
246
|
-
backgroundColor: AppColors.white,
|
|
247
|
-
borderWidth: 2.5,
|
|
248
|
-
borderColor: AppColors.purple,
|
|
249
|
-
alignItems: 'center',
|
|
250
|
-
justifyContent: 'center',
|
|
251
|
-
shadowColor: AppColors.black,
|
|
252
|
-
shadowOffset: {width: 0, height: 2},
|
|
253
|
-
shadowOpacity: 0.18,
|
|
254
|
-
shadowRadius: 3.5,
|
|
255
|
-
elevation: 4,
|
|
256
|
-
},
|
|
257
|
-
thumbActive: {
|
|
258
|
-
transform: [{scale: 1.15}],
|
|
259
|
-
shadowOpacity: 0.28,
|
|
260
|
-
shadowRadius: 5,
|
|
261
|
-
elevation: 6,
|
|
262
|
-
borderColor: AppColors.purple,
|
|
263
|
-
},
|
|
264
|
-
thumbCenterDot: {
|
|
265
|
-
width: 6,
|
|
266
|
-
height: 6,
|
|
267
|
-
borderRadius: 3,
|
|
268
|
-
backgroundColor: AppColors.purple,
|
|
269
|
-
},
|
|
270
|
-
presetRow: {
|
|
271
|
-
flexDirection: 'row',
|
|
272
|
-
alignItems: 'center',
|
|
273
|
-
justifyContent: 'space-between',
|
|
274
|
-
gap: 8,
|
|
275
|
-
marginTop: 2,
|
|
276
|
-
},
|
|
277
|
-
presetButton: {
|
|
278
|
-
flex: 1,
|
|
279
|
-
paddingVertical: 5,
|
|
280
|
-
borderRadius: 7,
|
|
281
|
-
alignItems: 'center',
|
|
282
|
-
backgroundColor: AppColors.grayBackground,
|
|
283
|
-
borderWidth: 1,
|
|
284
|
-
borderColor: AppColors.dividerColor,
|
|
285
|
-
},
|
|
286
|
-
presetButtonActive: {
|
|
287
|
-
backgroundColor: `${AppColors.purple}20`,
|
|
288
|
-
borderColor: AppColors.purple,
|
|
289
|
-
},
|
|
290
|
-
presetText: {
|
|
291
|
-
fontFamily: AppFonts.interBold,
|
|
292
|
-
fontSize: 10.5,
|
|
293
|
-
color: AppColors.grayText,
|
|
294
|
-
},
|
|
295
|
-
presetTextActive: {
|
|
296
|
-
color: AppColors.purple,
|
|
297
|
-
},
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
export default Slider;
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {View, Pressable, Text} from 'react-native';
|
|
3
|
-
import Svg, {Rect, Path} from 'react-native-svg';
|
|
4
|
-
|
|
5
|
-
// Components
|
|
6
|
-
import CopyButton from './CopyButton';
|
|
7
|
-
|
|
8
|
-
// Custom Hooks
|
|
9
|
-
import useAccordion from '../customHooks/useAccordion';
|
|
10
|
-
|
|
11
|
-
// Assets
|
|
12
|
-
import {ChevronIcon} from './NetworkIcons';
|
|
13
|
-
|
|
14
|
-
// Type Definition
|
|
15
|
-
import {SourcePageCardProps} from '../types';
|
|
16
|
-
|
|
17
|
-
// Stylesheet
|
|
18
|
-
import {AppColors} from '../styles/AppColors';
|
|
19
|
-
import styles from '../styles';
|
|
20
|
-
|
|
21
|
-
const SourcePageCard = ({routeInfo}: SourcePageCardProps) => {
|
|
22
|
-
const main = useAccordion(true);
|
|
23
|
-
const params = useAccordion(false);
|
|
24
|
-
|
|
25
|
-
const hasParams =
|
|
26
|
-
routeInfo.params && Object.keys(routeInfo.params).length > 0;
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<View style={styles.sourcePageCard}>
|
|
30
|
-
<Pressable onPress={main.toggleOpen} hitSlop={12}>
|
|
31
|
-
<View style={styles.sourcePageAccordionHeader}>
|
|
32
|
-
<View style={styles.sourcePageTop}>
|
|
33
|
-
<View style={styles.sourcePageIcon}>
|
|
34
|
-
<Svg width={14} height={14} viewBox="0 0 24 24" fill="none">
|
|
35
|
-
<Rect
|
|
36
|
-
x="3"
|
|
37
|
-
y="3"
|
|
38
|
-
width="7"
|
|
39
|
-
height="7"
|
|
40
|
-
rx="1.5"
|
|
41
|
-
stroke={AppColors.purple}
|
|
42
|
-
strokeWidth="2"
|
|
43
|
-
/>
|
|
44
|
-
<Rect
|
|
45
|
-
x="14"
|
|
46
|
-
y="3"
|
|
47
|
-
width="7"
|
|
48
|
-
height="7"
|
|
49
|
-
rx="1.5"
|
|
50
|
-
stroke={AppColors.purple}
|
|
51
|
-
strokeWidth="2"
|
|
52
|
-
/>
|
|
53
|
-
<Rect
|
|
54
|
-
x="3"
|
|
55
|
-
y="14"
|
|
56
|
-
width="7"
|
|
57
|
-
height="7"
|
|
58
|
-
rx="1.5"
|
|
59
|
-
stroke={AppColors.purple}
|
|
60
|
-
strokeWidth="2"
|
|
61
|
-
/>
|
|
62
|
-
<Path
|
|
63
|
-
d="M14 17.5h7M17.5 14v7"
|
|
64
|
-
stroke={AppColors.purple}
|
|
65
|
-
strokeWidth="2"
|
|
66
|
-
strokeLinecap="round"
|
|
67
|
-
/>
|
|
68
|
-
</Svg>
|
|
69
|
-
</View>
|
|
70
|
-
<View style={{flex: 1}}>
|
|
71
|
-
<Text style={styles.sourcePageLabel}>Source Page</Text>
|
|
72
|
-
<Text style={styles.sourcePageValue} numberOfLines={1}>
|
|
73
|
-
{routeInfo.path}
|
|
74
|
-
</Text>
|
|
75
|
-
</View>
|
|
76
|
-
</View>
|
|
77
|
-
<View style={styles.sourcePageHeaderRight}>
|
|
78
|
-
<CopyButton value={routeInfo.path} label="Source Path" />
|
|
79
|
-
<View style={styles.iconSquareBtn}>
|
|
80
|
-
<View style={main.chevronStyle}>
|
|
81
|
-
<ChevronIcon color={AppColors.grayTextStrong} size={14} />
|
|
82
|
-
</View>
|
|
83
|
-
</View>
|
|
84
|
-
</View>
|
|
85
|
-
</View>
|
|
86
|
-
</Pressable>
|
|
87
|
-
|
|
88
|
-
{main.isOpen && (
|
|
89
|
-
<View>
|
|
90
|
-
{hasParams && (
|
|
91
|
-
<View style={styles.sourceParamsBox}>
|
|
92
|
-
<Pressable onPress={params.toggleOpen} hitSlop={10}>
|
|
93
|
-
<View style={styles.paramsAccordionHeader}>
|
|
94
|
-
<View style={styles.paramsAccordionLeft}>
|
|
95
|
-
<Text style={styles.sourceParamsLabel}>Parameters</Text>
|
|
96
|
-
<View style={styles.headerCountBadge}>
|
|
97
|
-
<Text style={styles.headerCountText}>
|
|
98
|
-
{Object.keys(routeInfo.params).length}
|
|
99
|
-
</Text>
|
|
100
|
-
</View>
|
|
101
|
-
</View>
|
|
102
|
-
<View style={styles.paramsAccordionRight}>
|
|
103
|
-
<CopyButton value={routeInfo.params} label="Parameters" />
|
|
104
|
-
<View style={styles.iconSquareBtn}>
|
|
105
|
-
<View style={params.chevronStyle}>
|
|
106
|
-
<ChevronIcon color={AppColors.grayTextStrong} size={14} />
|
|
107
|
-
</View>
|
|
108
|
-
</View>
|
|
109
|
-
</View>
|
|
110
|
-
</View>
|
|
111
|
-
</Pressable>
|
|
112
|
-
|
|
113
|
-
{params.isOpen && (
|
|
114
|
-
<View style={styles.paramsBody}>
|
|
115
|
-
{Object.entries(routeInfo.params).map(([key, val], i, arr) => (
|
|
116
|
-
<View
|
|
117
|
-
key={key}
|
|
118
|
-
style={[
|
|
119
|
-
styles.paramRow,
|
|
120
|
-
i < arr.length - 1 ? styles.paramRowBorder : null,
|
|
121
|
-
]}>
|
|
122
|
-
<Text style={styles.paramKey}>{key}</Text>
|
|
123
|
-
<View style={styles.paramValueRow}>
|
|
124
|
-
<Text selectable style={styles.paramValue}>
|
|
125
|
-
{typeof val === 'object'
|
|
126
|
-
? JSON.stringify(val)
|
|
127
|
-
: String(val)}
|
|
128
|
-
</Text>
|
|
129
|
-
<CopyButton
|
|
130
|
-
value={
|
|
131
|
-
typeof val === 'object'
|
|
132
|
-
? JSON.stringify(val)
|
|
133
|
-
: String(val)
|
|
134
|
-
}
|
|
135
|
-
label={key}
|
|
136
|
-
/>
|
|
137
|
-
</View>
|
|
138
|
-
</View>
|
|
139
|
-
))}
|
|
140
|
-
</View>
|
|
141
|
-
)}
|
|
142
|
-
</View>
|
|
143
|
-
)}
|
|
144
|
-
</View>
|
|
145
|
-
)}
|
|
146
|
-
</View>
|
|
147
|
-
);
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
export default SourcePageCard;
|
package/src/components/Toast.tsx
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import React, {useState, useEffect, useRef} from 'react';
|
|
2
|
-
import {Animated, StyleSheet, Text, View, Platform} from 'react-native';
|
|
3
|
-
import {subscribeToast} from '../helpers/toast';
|
|
4
|
-
import {CheckIcon} from './NetworkIcons';
|
|
5
|
-
import {AppColors} from '../styles/AppColors';
|
|
6
|
-
import {AppFonts} from '../styles/AppFonts';
|
|
7
|
-
|
|
8
|
-
const Toast = React.memo(() => {
|
|
9
|
-
const [toastMessage, setToastMessage] = useState<string | null>(null);
|
|
10
|
-
const opacityAnim = useRef(new Animated.Value(0)).current;
|
|
11
|
-
const translateYAnim = useRef(new Animated.Value(20)).current;
|
|
12
|
-
const hideTimerRef = useRef<NodeJS.Timeout | null>(null);
|
|
13
|
-
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
const unsubscribe = subscribeToast((message: string) => {
|
|
16
|
-
if (hideTimerRef.current) {
|
|
17
|
-
clearTimeout(hideTimerRef.current);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
setToastMessage(message);
|
|
21
|
-
|
|
22
|
-
Animated.parallel([
|
|
23
|
-
Animated.timing(opacityAnim, {
|
|
24
|
-
toValue: 1,
|
|
25
|
-
duration: 180,
|
|
26
|
-
useNativeDriver: false,
|
|
27
|
-
}),
|
|
28
|
-
Animated.spring(translateYAnim, {
|
|
29
|
-
toValue: 0,
|
|
30
|
-
tension: 80,
|
|
31
|
-
friction: 8,
|
|
32
|
-
useNativeDriver: false,
|
|
33
|
-
}),
|
|
34
|
-
]).start();
|
|
35
|
-
|
|
36
|
-
hideTimerRef.current = setTimeout(() => {
|
|
37
|
-
Animated.parallel([
|
|
38
|
-
Animated.timing(opacityAnim, {
|
|
39
|
-
toValue: 0,
|
|
40
|
-
duration: 200,
|
|
41
|
-
useNativeDriver: false,
|
|
42
|
-
}),
|
|
43
|
-
Animated.timing(translateYAnim, {
|
|
44
|
-
toValue: 20,
|
|
45
|
-
duration: 200,
|
|
46
|
-
useNativeDriver: false,
|
|
47
|
-
}),
|
|
48
|
-
]).start(() => {
|
|
49
|
-
setToastMessage(null);
|
|
50
|
-
});
|
|
51
|
-
}, 2000);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
return () => {
|
|
55
|
-
unsubscribe();
|
|
56
|
-
if (hideTimerRef.current) {
|
|
57
|
-
clearTimeout(hideTimerRef.current);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}, [opacityAnim, translateYAnim]);
|
|
61
|
-
|
|
62
|
-
if (!toastMessage) {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<Animated.View
|
|
68
|
-
pointerEvents="none"
|
|
69
|
-
style={[
|
|
70
|
-
styles.toastContainer,
|
|
71
|
-
{
|
|
72
|
-
opacity: opacityAnim,
|
|
73
|
-
transform: [{translateY: translateYAnim}],
|
|
74
|
-
},
|
|
75
|
-
]}>
|
|
76
|
-
<View style={styles.toastCard}>
|
|
77
|
-
<View style={styles.iconCircle}>
|
|
78
|
-
<CheckIcon color={AppColors.white} size={11} />
|
|
79
|
-
</View>
|
|
80
|
-
<Text style={styles.toastText} numberOfLines={2}>
|
|
81
|
-
{toastMessage}
|
|
82
|
-
</Text>
|
|
83
|
-
</View>
|
|
84
|
-
</Animated.View>
|
|
85
|
-
);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
const styles = StyleSheet.create({
|
|
89
|
-
toastContainer: {
|
|
90
|
-
position: 'absolute',
|
|
91
|
-
bottom: Platform.OS === 'ios' ? 44 : 28,
|
|
92
|
-
left: 20,
|
|
93
|
-
right: 20,
|
|
94
|
-
alignItems: 'center',
|
|
95
|
-
justifyContent: 'center',
|
|
96
|
-
zIndex: 999999,
|
|
97
|
-
},
|
|
98
|
-
toastCard: {
|
|
99
|
-
flexDirection: 'row',
|
|
100
|
-
alignItems: 'center',
|
|
101
|
-
backgroundColor: AppColors.toastBg,
|
|
102
|
-
paddingVertical: 10,
|
|
103
|
-
paddingHorizontal: 16,
|
|
104
|
-
borderRadius: 24,
|
|
105
|
-
shadowColor: AppColors.black,
|
|
106
|
-
shadowOffset: {width: 0, height: 6},
|
|
107
|
-
shadowOpacity: 0.28,
|
|
108
|
-
shadowRadius: 10,
|
|
109
|
-
elevation: 8,
|
|
110
|
-
borderWidth: 1,
|
|
111
|
-
borderColor: AppColors.toastBorder,
|
|
112
|
-
maxWidth: '90%',
|
|
113
|
-
gap: 9,
|
|
114
|
-
},
|
|
115
|
-
iconCircle: {
|
|
116
|
-
width: 18,
|
|
117
|
-
height: 18,
|
|
118
|
-
borderRadius: 9,
|
|
119
|
-
backgroundColor: AppColors.greenColor,
|
|
120
|
-
alignItems: 'center',
|
|
121
|
-
justifyContent: 'center',
|
|
122
|
-
},
|
|
123
|
-
toastText: {
|
|
124
|
-
color: AppColors.white,
|
|
125
|
-
fontFamily: AppFonts.interBold,
|
|
126
|
-
fontSize: 12.5,
|
|
127
|
-
letterSpacing: -0.1,
|
|
128
|
-
},
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
export default Toast;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {Pressable, PressableProps} from 'react-native';
|
|
3
|
-
import {triggerNativeHaptic} from '../native/NativeInspector';
|
|
4
|
-
|
|
5
|
-
export interface TouchableScaleProps extends PressableProps {
|
|
6
|
-
onPress?: () => void;
|
|
7
|
-
onLongPress?: () => void;
|
|
8
|
-
style?: any;
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
hitSlop?: any;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
enableHaptics?: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const TouchableScale = React.memo(function TouchableScale({
|
|
16
|
-
onPress,
|
|
17
|
-
onLongPress,
|
|
18
|
-
style,
|
|
19
|
-
children,
|
|
20
|
-
hitSlop,
|
|
21
|
-
disabled,
|
|
22
|
-
enableHaptics = true,
|
|
23
|
-
accessible,
|
|
24
|
-
accessibilityRole,
|
|
25
|
-
accessibilityLabel,
|
|
26
|
-
accessibilityHint,
|
|
27
|
-
accessibilityState,
|
|
28
|
-
accessibilityValue,
|
|
29
|
-
...rest
|
|
30
|
-
}: TouchableScaleProps) {
|
|
31
|
-
const handlePressIn = () => {
|
|
32
|
-
if (disabled) return;
|
|
33
|
-
if (enableHaptics) {
|
|
34
|
-
triggerNativeHaptic('light');
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<Pressable
|
|
40
|
-
accessible={accessible}
|
|
41
|
-
accessibilityRole={accessibilityRole}
|
|
42
|
-
accessibilityLabel={accessibilityLabel}
|
|
43
|
-
accessibilityHint={accessibilityHint}
|
|
44
|
-
accessibilityState={accessibilityState}
|
|
45
|
-
accessibilityValue={accessibilityValue}
|
|
46
|
-
disabled={disabled}
|
|
47
|
-
style={({pressed}) => [
|
|
48
|
-
typeof style === 'function' ? style({pressed}) : style,
|
|
49
|
-
pressed && !disabled && {opacity: 0.82, transform: [{scale: 0.96}]},
|
|
50
|
-
]}
|
|
51
|
-
onPressIn={handlePressIn}
|
|
52
|
-
onPress={onPress}
|
|
53
|
-
onLongPress={onLongPress}
|
|
54
|
-
hitSlop={hitSlop}
|
|
55
|
-
{...rest}>
|
|
56
|
-
{children}
|
|
57
|
-
</Pressable>
|
|
58
|
-
);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
export default TouchableScale;
|