@multiplayer-app/session-recorder-react-native 0.0.1-alpha.1 → 0.0.1-alpha.10
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/RRWEB_INTEGRATION.md +336 -0
- package/VIEWSHOT_INTEGRATION_TEST.md +123 -0
- package/copy-react-native-dist.sh +38 -0
- package/dist/components/GestureCaptureWrapper/GestureCaptureWrapper.d.ts +6 -0
- package/dist/components/GestureCaptureWrapper/GestureCaptureWrapper.js +1 -0
- package/dist/components/GestureCaptureWrapper/GestureCaptureWrapper.js.map +1 -0
- package/dist/components/GestureCaptureWrapper/index.d.ts +1 -0
- package/dist/components/GestureCaptureWrapper/index.js +1 -0
- package/dist/components/GestureCaptureWrapper/index.js.map +1 -0
- package/dist/components/GestureCaptureWrapper.d.ts +6 -0
- package/dist/components/GestureCaptureWrapper.js +1 -0
- package/dist/components/GestureCaptureWrapper.js.map +1 -0
- package/dist/components/ScreenRecorderView/ScreenRecorderView.d.ts +5 -0
- package/dist/components/ScreenRecorderView/ScreenRecorderView.js +1 -0
- package/dist/components/ScreenRecorderView/ScreenRecorderView.js.map +1 -0
- package/dist/components/ScreenRecorderView/index.d.ts +1 -0
- package/dist/components/ScreenRecorderView/index.js +1 -0
- package/dist/components/ScreenRecorderView/index.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -0
- package/dist/config/constants.d.ts +18 -0
- package/dist/config/constants.js +1 -0
- package/dist/config/constants.js.map +1 -0
- package/dist/config/defaults.d.ts +4 -0
- package/dist/config/defaults.js +1 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/masking.d.ts +2 -30
- package/dist/config/masking.js +1 -1
- package/dist/config/masking.js.map +1 -1
- package/dist/config/session-recorder.d.ts +2 -0
- package/dist/config/session-recorder.js +1 -0
- package/dist/config/session-recorder.js.map +1 -0
- package/dist/config/validators.d.ts +10 -0
- package/dist/config/validators.js +1 -0
- package/dist/config/validators.js.map +1 -0
- package/dist/context/SessionRecorderContext.d.ts +12 -0
- package/dist/context/SessionRecorderContext.js +1 -0
- package/dist/context/SessionRecorderContext.js.map +1 -0
- package/dist/expo.d.ts +5 -9
- package/dist/expo.js +1 -1
- package/dist/expo.js.map +1 -1
- package/dist/index.d.ts +6 -10
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/otel/helpers.d.ts +45 -3
- package/dist/otel/helpers.js +1 -1
- package/dist/otel/helpers.js.map +1 -1
- package/dist/otel/index.d.ts +4 -25
- package/dist/otel/index.js +1 -1
- package/dist/otel/index.js.map +1 -1
- package/dist/otel/instrumentations/gestureInstrumentation.js +1 -1
- package/dist/otel/instrumentations/gestureInstrumentation.js.map +1 -1
- package/dist/otel/instrumentations/index.d.ts +3 -4
- package/dist/otel/instrumentations/index.js +1 -1
- package/dist/otel/instrumentations/index.js.map +1 -1
- package/dist/otel/instrumentations/reactNativeInstrumentation.js +1 -1
- package/dist/otel/instrumentations/reactNativeInstrumentation.js.map +1 -1
- package/dist/otel/instrumentations/reactNavigationInstrumentation.d.ts +1 -0
- package/dist/otel/instrumentations/reactNavigationInstrumentation.js +1 -1
- package/dist/otel/instrumentations/reactNavigationInstrumentation.js.map +1 -1
- package/dist/patch/index.d.ts +1 -0
- package/dist/patch/index.js +1 -0
- package/dist/patch/index.js.map +1 -0
- package/dist/patch/xhr.d.ts +2 -0
- package/dist/patch/xhr.js +1 -0
- package/dist/patch/xhr.js.map +1 -0
- package/dist/recorder/eventExporter.d.ts +21 -0
- package/dist/recorder/eventExporter.js +1 -0
- package/dist/recorder/eventExporter.js.map +1 -0
- package/dist/recorder/gestureHandlerRecorder.d.ts +19 -0
- package/dist/recorder/gestureHandlerRecorder.js +1 -0
- package/dist/recorder/gestureHandlerRecorder.js.map +1 -0
- package/dist/recorder/gestureRecorder.d.ts +68 -11
- package/dist/recorder/gestureRecorder.js +1 -1
- package/dist/recorder/gestureRecorder.js.map +1 -1
- package/dist/recorder/index.d.ts +60 -6
- package/dist/recorder/index.js +1 -1
- package/dist/recorder/index.js.map +1 -1
- package/dist/recorder/navigationTracker.js +1 -1
- package/dist/recorder/navigationTracker.js.map +1 -1
- package/dist/recorder/screenRecorder.d.ts +79 -10
- package/dist/recorder/screenRecorder.js +1 -1
- package/dist/recorder/screenRecorder.js.map +1 -1
- package/dist/services/api.service.d.ts +62 -10
- package/dist/services/api.service.js +1 -1
- package/dist/services/api.service.js.map +1 -1
- package/dist/services/storage.service.d.ts +23 -16
- package/dist/services/storage.service.js +1 -1
- package/dist/services/storage.service.js.map +1 -1
- package/dist/session-recorder.d.ts +166 -0
- package/dist/session-recorder.js +1 -0
- package/dist/session-recorder.js.map +1 -0
- package/dist/types/index.d.ts +15 -76
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/rrweb.d.ts +118 -0
- package/dist/types/rrweb.js +1 -0
- package/dist/types/rrweb.js.map +1 -0
- package/dist/types/session-recorder.d.ts +366 -0
- package/dist/types/session-recorder.js +1 -0
- package/dist/types/session-recorder.js.map +1 -0
- package/dist/types/session.d.ts +59 -0
- package/dist/types/session.js +1 -0
- package/dist/types/session.js.map +1 -0
- package/dist/utils/app-metadata.d.ts +16 -0
- package/dist/utils/app-metadata.js +1 -0
- package/dist/utils/app-metadata.js.map +1 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +112 -0
- package/dist/utils/logger.js +1 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/platform.d.ts +37 -0
- package/dist/utils/platform.js +1 -1
- package/dist/utils/platform.js.map +1 -1
- package/dist/utils/request-utils.d.ts +21 -0
- package/dist/utils/request-utils.js +1 -0
- package/dist/utils/request-utils.js.map +1 -0
- package/dist/utils/rrweb-events.d.ts +65 -0
- package/dist/utils/rrweb-events.js +1 -0
- package/dist/utils/rrweb-events.js.map +1 -0
- package/dist/utils/session.d.ts +5 -0
- package/dist/utils/session.js +1 -0
- package/dist/utils/session.js.map +1 -0
- package/dist/utils/time.d.ts +4 -0
- package/dist/utils/time.js +1 -0
- package/dist/utils/time.js.map +1 -0
- package/dist/utils/type-utils.d.ts +16 -0
- package/dist/utils/type-utils.js +1 -0
- package/dist/utils/type-utils.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/docs/AUTO_METADATA_DETECTION.md +108 -0
- package/package.json +10 -9
- package/scripts/generate-app-metadata.js +173 -0
- package/src/components/GestureCaptureWrapper/GestureCaptureWrapper.tsx +86 -0
- package/src/components/GestureCaptureWrapper/index.ts +1 -0
- package/src/components/ScreenRecorderView/ScreenRecorderView.tsx +72 -0
- package/src/components/ScreenRecorderView/index.ts +1 -0
- package/src/components/index.ts +1 -0
- package/src/config/constants.ts +60 -0
- package/src/config/defaults.ts +82 -0
- package/src/config/index.ts +6 -0
- package/src/config/masking.ts +10 -61
- package/src/config/session-recorder.ts +55 -0
- package/src/config/validators.ts +31 -0
- package/src/context/SessionRecorderContext.tsx +75 -0
- package/src/expo.ts +7 -37
- package/src/index.ts +14 -17
- package/src/otel/helpers.ts +265 -11
- package/src/otel/index.ts +37 -247
- package/src/otel/instrumentations/index.ts +82 -53
- package/src/patch/index.ts +1 -0
- package/src/patch/xhr.ts +142 -0
- package/src/recorder/eventExporter.ts +141 -0
- package/src/recorder/gestureRecorder.ts +194 -125
- package/src/recorder/index.ts +132 -24
- package/src/recorder/navigationTracker.ts +12 -10
- package/src/recorder/screenRecorder.ts +242 -155
- package/src/services/api.service.ts +170 -45
- package/src/services/storage.service.ts +102 -74
- package/src/session-recorder.ts +600 -0
- package/src/types/index.ts +19 -79
- package/src/types/session-recorder.ts +423 -0
- package/src/types/session.ts +65 -0
- package/src/utils/app-metadata.ts +31 -0
- package/src/utils/index.ts +8 -0
- package/src/utils/logger.ts +225 -0
- package/src/utils/platform.ts +321 -6
- package/src/utils/request-utils.ts +61 -0
- package/src/utils/rrweb-events.ts +309 -0
- package/src/utils/session.ts +18 -0
- package/src/utils/time.ts +17 -0
- package/src/utils/type-utils.ts +75 -0
- package/src/version.ts +1 -1
- package/dist/sessionRecorder.d.ts +0 -54
- package/dist/sessionRecorder.js +0 -1
- package/dist/sessionRecorder.js.map +0 -1
- package/examples/sample-expo-app/README.md +0 -142
- package/examples/sample-expo-app/app/(tabs)/_layout.tsx +0 -60
- package/examples/sample-expo-app/app/(tabs)/explore.tsx +0 -110
- package/examples/sample-expo-app/app/(tabs)/index.tsx +0 -125
- package/examples/sample-expo-app/app/(tabs)/posts.tsx +0 -96
- package/examples/sample-expo-app/app/(tabs)/users.tsx +0 -131
- package/examples/sample-expo-app/app/+not-found.tsx +0 -32
- package/examples/sample-expo-app/app/_layout.tsx +0 -53
- package/examples/sample-expo-app/app/post/[id].tsx +0 -199
- package/examples/sample-expo-app/app/user/[id].tsx +0 -270
- package/examples/sample-expo-app/app.json +0 -42
- package/examples/sample-expo-app/assets/fonts/SpaceMono-Regular.ttf +0 -0
- package/examples/sample-expo-app/assets/images/adaptive-icon.png +0 -0
- package/examples/sample-expo-app/assets/images/favicon.png +0 -0
- package/examples/sample-expo-app/assets/images/icon.png +0 -0
- package/examples/sample-expo-app/assets/images/partial-react-logo.png +0 -0
- package/examples/sample-expo-app/assets/images/react-logo.png +0 -0
- package/examples/sample-expo-app/assets/images/react-logo@2x.png +0 -0
- package/examples/sample-expo-app/assets/images/react-logo@3x.png +0 -0
- package/examples/sample-expo-app/assets/images/splash-icon.png +0 -0
- package/examples/sample-expo-app/components/Collapsible.tsx +0 -45
- package/examples/sample-expo-app/components/ErrorView.tsx +0 -52
- package/examples/sample-expo-app/components/ExternalLink.tsx +0 -24
- package/examples/sample-expo-app/components/HapticTab.tsx +0 -18
- package/examples/sample-expo-app/components/HelloWave.tsx +0 -40
- package/examples/sample-expo-app/components/LoadingSpinner.tsx +0 -34
- package/examples/sample-expo-app/components/ParallaxScrollView.tsx +0 -82
- package/examples/sample-expo-app/components/ThemedText.tsx +0 -60
- package/examples/sample-expo-app/components/ThemedView.tsx +0 -14
- package/examples/sample-expo-app/components/ui/IconSymbol.ios.tsx +0 -32
- package/examples/sample-expo-app/components/ui/IconSymbol.tsx +0 -41
- package/examples/sample-expo-app/components/ui/TabBarBackground.ios.tsx +0 -19
- package/examples/sample-expo-app/components/ui/TabBarBackground.tsx +0 -6
- package/examples/sample-expo-app/constants/Colors.ts +0 -26
- package/examples/sample-expo-app/eslint.config.js +0 -10
- package/examples/sample-expo-app/hooks/useApi.ts +0 -41
- package/examples/sample-expo-app/hooks/useColorScheme.ts +0 -1
- package/examples/sample-expo-app/hooks/useColorScheme.web.ts +0 -21
- package/examples/sample-expo-app/hooks/useThemeColor.ts +0 -21
- package/examples/sample-expo-app/metro.config.js +0 -26
- package/examples/sample-expo-app/package-lock.json +0 -26296
- package/examples/sample-expo-app/package.json +0 -59
- package/examples/sample-expo-app/scripts/reset-project.js +0 -112
- package/examples/sample-expo-app/services/api.ts +0 -98
- package/examples/sample-expo-app/tsconfig.json +0 -17
- package/examples/sample-expo-app/utils/navigation.ts +0 -19
- package/src/otel/instrumentations/gestureInstrumentation.ts +0 -141
- package/src/otel/instrumentations/reactNativeInstrumentation.ts +0 -164
- package/src/otel/instrumentations/reactNavigationInstrumentation.ts +0 -114
- package/src/sessionRecorder.ts +0 -367
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
import { StyleSheet } from 'react-native';
|
|
3
|
-
import Animated, {
|
|
4
|
-
useAnimatedStyle,
|
|
5
|
-
useSharedValue,
|
|
6
|
-
withRepeat,
|
|
7
|
-
withSequence,
|
|
8
|
-
withTiming,
|
|
9
|
-
} from 'react-native-reanimated';
|
|
10
|
-
|
|
11
|
-
import { ThemedText } from '@/components/ThemedText';
|
|
12
|
-
|
|
13
|
-
export function HelloWave() {
|
|
14
|
-
const rotationAnimation = useSharedValue(0);
|
|
15
|
-
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
rotationAnimation.value = withRepeat(
|
|
18
|
-
withSequence(withTiming(25, { duration: 150 }), withTiming(0, { duration: 150 })),
|
|
19
|
-
4 // Run the animation 4 times
|
|
20
|
-
);
|
|
21
|
-
}, [rotationAnimation]);
|
|
22
|
-
|
|
23
|
-
const animatedStyle = useAnimatedStyle(() => ({
|
|
24
|
-
transform: [{ rotate: `${rotationAnimation.value}deg` }],
|
|
25
|
-
}));
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<Animated.View style={animatedStyle}>
|
|
29
|
-
<ThemedText style={styles.text}>👋</ThemedText>
|
|
30
|
-
</Animated.View>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const styles = StyleSheet.create({
|
|
35
|
-
text: {
|
|
36
|
-
fontSize: 28,
|
|
37
|
-
lineHeight: 32,
|
|
38
|
-
marginTop: -6,
|
|
39
|
-
},
|
|
40
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { ActivityIndicator, StyleSheet } from 'react-native'
|
|
3
|
-
import { ThemedView } from './ThemedView'
|
|
4
|
-
import { ThemedText } from './ThemedText'
|
|
5
|
-
import { Colors } from '@/constants/Colors'
|
|
6
|
-
import { useColorScheme } from '@/hooks/useColorScheme'
|
|
7
|
-
|
|
8
|
-
interface LoadingSpinnerProps {
|
|
9
|
-
message?: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function LoadingSpinner({ message = 'Loading...' }: LoadingSpinnerProps) {
|
|
13
|
-
const colorScheme = useColorScheme()
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<ThemedView style={styles.container}>
|
|
17
|
-
<ActivityIndicator size='large' color={Colors[colorScheme ?? 'light'].tint} />
|
|
18
|
-
<ThemedText style={styles.message}>{message}</ThemedText>
|
|
19
|
-
</ThemedView>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const styles = StyleSheet.create({
|
|
24
|
-
container: {
|
|
25
|
-
flex: 1,
|
|
26
|
-
justifyContent: 'center',
|
|
27
|
-
alignItems: 'center',
|
|
28
|
-
padding: 20
|
|
29
|
-
},
|
|
30
|
-
message: {
|
|
31
|
-
marginTop: 16,
|
|
32
|
-
textAlign: 'center'
|
|
33
|
-
}
|
|
34
|
-
})
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import { StyleSheet } from 'react-native';
|
|
3
|
-
import Animated, {
|
|
4
|
-
interpolate,
|
|
5
|
-
useAnimatedRef,
|
|
6
|
-
useAnimatedStyle,
|
|
7
|
-
useScrollViewOffset,
|
|
8
|
-
} from 'react-native-reanimated';
|
|
9
|
-
|
|
10
|
-
import { ThemedView } from '@/components/ThemedView';
|
|
11
|
-
import { useBottomTabOverflow } from '@/components/ui/TabBarBackground';
|
|
12
|
-
import { useColorScheme } from '@/hooks/useColorScheme';
|
|
13
|
-
|
|
14
|
-
const HEADER_HEIGHT = 250;
|
|
15
|
-
|
|
16
|
-
type Props = PropsWithChildren<{
|
|
17
|
-
headerImage: ReactElement;
|
|
18
|
-
headerBackgroundColor: { dark: string; light: string };
|
|
19
|
-
}>;
|
|
20
|
-
|
|
21
|
-
export default function ParallaxScrollView({
|
|
22
|
-
children,
|
|
23
|
-
headerImage,
|
|
24
|
-
headerBackgroundColor,
|
|
25
|
-
}: Props) {
|
|
26
|
-
const colorScheme = useColorScheme() ?? 'light';
|
|
27
|
-
const scrollRef = useAnimatedRef<Animated.ScrollView>();
|
|
28
|
-
const scrollOffset = useScrollViewOffset(scrollRef);
|
|
29
|
-
const bottom = useBottomTabOverflow();
|
|
30
|
-
const headerAnimatedStyle = useAnimatedStyle(() => {
|
|
31
|
-
return {
|
|
32
|
-
transform: [
|
|
33
|
-
{
|
|
34
|
-
translateY: interpolate(
|
|
35
|
-
scrollOffset.value,
|
|
36
|
-
[-HEADER_HEIGHT, 0, HEADER_HEIGHT],
|
|
37
|
-
[-HEADER_HEIGHT / 2, 0, HEADER_HEIGHT * 0.75]
|
|
38
|
-
),
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
scale: interpolate(scrollOffset.value, [-HEADER_HEIGHT, 0, HEADER_HEIGHT], [2, 1, 1]),
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<ThemedView style={styles.container}>
|
|
49
|
-
<Animated.ScrollView
|
|
50
|
-
ref={scrollRef}
|
|
51
|
-
scrollEventThrottle={16}
|
|
52
|
-
scrollIndicatorInsets={{ bottom }}
|
|
53
|
-
contentContainerStyle={{ paddingBottom: bottom }}>
|
|
54
|
-
<Animated.View
|
|
55
|
-
style={[
|
|
56
|
-
styles.header,
|
|
57
|
-
{ backgroundColor: headerBackgroundColor[colorScheme] },
|
|
58
|
-
headerAnimatedStyle,
|
|
59
|
-
]}>
|
|
60
|
-
{headerImage}
|
|
61
|
-
</Animated.View>
|
|
62
|
-
<ThemedView style={styles.content}>{children}</ThemedView>
|
|
63
|
-
</Animated.ScrollView>
|
|
64
|
-
</ThemedView>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const styles = StyleSheet.create({
|
|
69
|
-
container: {
|
|
70
|
-
flex: 1,
|
|
71
|
-
},
|
|
72
|
-
header: {
|
|
73
|
-
height: HEADER_HEIGHT,
|
|
74
|
-
overflow: 'hidden',
|
|
75
|
-
},
|
|
76
|
-
content: {
|
|
77
|
-
flex: 1,
|
|
78
|
-
padding: 32,
|
|
79
|
-
gap: 16,
|
|
80
|
-
overflow: 'hidden',
|
|
81
|
-
},
|
|
82
|
-
});
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { StyleSheet, Text, type TextProps } from 'react-native';
|
|
2
|
-
|
|
3
|
-
import { useThemeColor } from '@/hooks/useThemeColor';
|
|
4
|
-
|
|
5
|
-
export type ThemedTextProps = TextProps & {
|
|
6
|
-
lightColor?: string;
|
|
7
|
-
darkColor?: string;
|
|
8
|
-
type?: 'default' | 'title' | 'defaultSemiBold' | 'subtitle' | 'link';
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export function ThemedText({
|
|
12
|
-
style,
|
|
13
|
-
lightColor,
|
|
14
|
-
darkColor,
|
|
15
|
-
type = 'default',
|
|
16
|
-
...rest
|
|
17
|
-
}: ThemedTextProps) {
|
|
18
|
-
const color = useThemeColor({ light: lightColor, dark: darkColor }, 'text');
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<Text
|
|
22
|
-
style={[
|
|
23
|
-
{ color },
|
|
24
|
-
type === 'default' ? styles.default : undefined,
|
|
25
|
-
type === 'title' ? styles.title : undefined,
|
|
26
|
-
type === 'defaultSemiBold' ? styles.defaultSemiBold : undefined,
|
|
27
|
-
type === 'subtitle' ? styles.subtitle : undefined,
|
|
28
|
-
type === 'link' ? styles.link : undefined,
|
|
29
|
-
style,
|
|
30
|
-
]}
|
|
31
|
-
{...rest}
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const styles = StyleSheet.create({
|
|
37
|
-
default: {
|
|
38
|
-
fontSize: 16,
|
|
39
|
-
lineHeight: 24,
|
|
40
|
-
},
|
|
41
|
-
defaultSemiBold: {
|
|
42
|
-
fontSize: 16,
|
|
43
|
-
lineHeight: 24,
|
|
44
|
-
fontWeight: '600',
|
|
45
|
-
},
|
|
46
|
-
title: {
|
|
47
|
-
fontSize: 32,
|
|
48
|
-
fontWeight: 'bold',
|
|
49
|
-
lineHeight: 32,
|
|
50
|
-
},
|
|
51
|
-
subtitle: {
|
|
52
|
-
fontSize: 20,
|
|
53
|
-
fontWeight: 'bold',
|
|
54
|
-
},
|
|
55
|
-
link: {
|
|
56
|
-
lineHeight: 30,
|
|
57
|
-
fontSize: 16,
|
|
58
|
-
color: '#0a7ea4',
|
|
59
|
-
},
|
|
60
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { View, type ViewProps } from 'react-native';
|
|
2
|
-
|
|
3
|
-
import { useThemeColor } from '@/hooks/useThemeColor';
|
|
4
|
-
|
|
5
|
-
export type ThemedViewProps = ViewProps & {
|
|
6
|
-
lightColor?: string;
|
|
7
|
-
darkColor?: string;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export function ThemedView({ style, lightColor, darkColor, ...otherProps }: ThemedViewProps) {
|
|
11
|
-
const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor }, 'background');
|
|
12
|
-
|
|
13
|
-
return <View style={[{ backgroundColor }, style]} {...otherProps} />;
|
|
14
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { SymbolView, SymbolViewProps, SymbolWeight } from 'expo-symbols';
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
|
|
4
|
-
export function IconSymbol({
|
|
5
|
-
name,
|
|
6
|
-
size = 24,
|
|
7
|
-
color,
|
|
8
|
-
style,
|
|
9
|
-
weight = 'regular',
|
|
10
|
-
}: {
|
|
11
|
-
name: SymbolViewProps['name'];
|
|
12
|
-
size?: number;
|
|
13
|
-
color: string;
|
|
14
|
-
style?: StyleProp<ViewStyle>;
|
|
15
|
-
weight?: SymbolWeight;
|
|
16
|
-
}) {
|
|
17
|
-
return (
|
|
18
|
-
<SymbolView
|
|
19
|
-
weight={weight}
|
|
20
|
-
tintColor={color}
|
|
21
|
-
resizeMode="scaleAspectFit"
|
|
22
|
-
name={name}
|
|
23
|
-
style={[
|
|
24
|
-
{
|
|
25
|
-
width: size,
|
|
26
|
-
height: size,
|
|
27
|
-
},
|
|
28
|
-
style,
|
|
29
|
-
]}
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// Fallback for using MaterialIcons on Android and web.
|
|
2
|
-
|
|
3
|
-
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
|
4
|
-
import { SymbolWeight, SymbolViewProps } from 'expo-symbols';
|
|
5
|
-
import { ComponentProps } from 'react';
|
|
6
|
-
import { OpaqueColorValue, type StyleProp, type TextStyle } from 'react-native';
|
|
7
|
-
|
|
8
|
-
type IconMapping = Record<SymbolViewProps['name'], ComponentProps<typeof MaterialIcons>['name']>;
|
|
9
|
-
type IconSymbolName = keyof typeof MAPPING;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Add your SF Symbols to Material Icons mappings here.
|
|
13
|
-
* - see Material Icons in the [Icons Directory](https://icons.expo.fyi).
|
|
14
|
-
* - see SF Symbols in the [SF Symbols](https://developer.apple.com/sf-symbols/) app.
|
|
15
|
-
*/
|
|
16
|
-
const MAPPING = {
|
|
17
|
-
'house.fill': 'home',
|
|
18
|
-
'paperplane.fill': 'send',
|
|
19
|
-
'chevron.left.forwardslash.chevron.right': 'code',
|
|
20
|
-
'chevron.right': 'chevron-right',
|
|
21
|
-
} as IconMapping;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* An icon component that uses native SF Symbols on iOS, and Material Icons on Android and web.
|
|
25
|
-
* This ensures a consistent look across platforms, and optimal resource usage.
|
|
26
|
-
* Icon `name`s are based on SF Symbols and require manual mapping to Material Icons.
|
|
27
|
-
*/
|
|
28
|
-
export function IconSymbol({
|
|
29
|
-
name,
|
|
30
|
-
size = 24,
|
|
31
|
-
color,
|
|
32
|
-
style,
|
|
33
|
-
}: {
|
|
34
|
-
name: IconSymbolName;
|
|
35
|
-
size?: number;
|
|
36
|
-
color: string | OpaqueColorValue;
|
|
37
|
-
style?: StyleProp<TextStyle>;
|
|
38
|
-
weight?: SymbolWeight;
|
|
39
|
-
}) {
|
|
40
|
-
return <MaterialIcons color={color} size={size} name={MAPPING[name]} style={style} />;
|
|
41
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useBottomTabBarHeight } from '@react-navigation/bottom-tabs';
|
|
2
|
-
import { BlurView } from 'expo-blur';
|
|
3
|
-
import { StyleSheet } from 'react-native';
|
|
4
|
-
|
|
5
|
-
export default function BlurTabBarBackground() {
|
|
6
|
-
return (
|
|
7
|
-
<BlurView
|
|
8
|
-
// System chrome material automatically adapts to the system's theme
|
|
9
|
-
// and matches the native tab bar appearance on iOS.
|
|
10
|
-
tint="systemChromeMaterial"
|
|
11
|
-
intensity={100}
|
|
12
|
-
style={StyleSheet.absoluteFill}
|
|
13
|
-
/>
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function useBottomTabOverflow() {
|
|
18
|
-
return useBottomTabBarHeight();
|
|
19
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Below are the colors that are used in the app. The colors are defined in the light and dark mode.
|
|
3
|
-
* There are many other ways to style your app. For example, [Nativewind](https://www.nativewind.dev/), [Tamagui](https://tamagui.dev/), [unistyles](https://reactnativeunistyles.vercel.app), etc.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const tintColorLight = '#0a7ea4';
|
|
7
|
-
const tintColorDark = '#fff';
|
|
8
|
-
|
|
9
|
-
export const Colors = {
|
|
10
|
-
light: {
|
|
11
|
-
text: '#11181C',
|
|
12
|
-
background: '#fff',
|
|
13
|
-
tint: tintColorLight,
|
|
14
|
-
icon: '#687076',
|
|
15
|
-
tabIconDefault: '#687076',
|
|
16
|
-
tabIconSelected: tintColorLight,
|
|
17
|
-
},
|
|
18
|
-
dark: {
|
|
19
|
-
text: '#ECEDEE',
|
|
20
|
-
background: '#151718',
|
|
21
|
-
tint: tintColorDark,
|
|
22
|
-
icon: '#9BA1A6',
|
|
23
|
-
tabIconDefault: '#9BA1A6',
|
|
24
|
-
tabIconSelected: tintColorDark,
|
|
25
|
-
},
|
|
26
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
interface ApiState<T> {
|
|
4
|
-
data: T | null;
|
|
5
|
-
loading: boolean;
|
|
6
|
-
error: string | null;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function useApi<T>(
|
|
10
|
-
apiCall: () => Promise<T>,
|
|
11
|
-
dependencies: any[] = []
|
|
12
|
-
): ApiState<T> & { refetch: () => void } {
|
|
13
|
-
const [state, setState] = useState<ApiState<T>>({
|
|
14
|
-
data: null,
|
|
15
|
-
loading: true,
|
|
16
|
-
error: null,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const fetchData = async () => {
|
|
20
|
-
setState(prev => ({ ...prev, loading: true, error: null }));
|
|
21
|
-
try {
|
|
22
|
-
const data = await apiCall();
|
|
23
|
-
setState({ data, loading: false, error: null });
|
|
24
|
-
} catch (error) {
|
|
25
|
-
setState({
|
|
26
|
-
data: null,
|
|
27
|
-
loading: false,
|
|
28
|
-
error: error instanceof Error ? error.message : 'An error occurred',
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
fetchData();
|
|
35
|
-
}, dependencies);
|
|
36
|
-
|
|
37
|
-
return {
|
|
38
|
-
...state,
|
|
39
|
-
refetch: fetchData,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useColorScheme } from 'react-native';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
import { useColorScheme as useRNColorScheme } from 'react-native';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* To support static rendering, this value needs to be re-calculated on the client side for web
|
|
6
|
-
*/
|
|
7
|
-
export function useColorScheme() {
|
|
8
|
-
const [hasHydrated, setHasHydrated] = useState(false);
|
|
9
|
-
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
setHasHydrated(true);
|
|
12
|
-
}, []);
|
|
13
|
-
|
|
14
|
-
const colorScheme = useRNColorScheme();
|
|
15
|
-
|
|
16
|
-
if (hasHydrated) {
|
|
17
|
-
return colorScheme;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return 'light';
|
|
21
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Learn more about light and dark modes:
|
|
3
|
-
* https://docs.expo.dev/guides/color-schemes/
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { Colors } from '@/constants/Colors';
|
|
7
|
-
import { useColorScheme } from '@/hooks/useColorScheme';
|
|
8
|
-
|
|
9
|
-
export function useThemeColor(
|
|
10
|
-
props: { light?: string; dark?: string },
|
|
11
|
-
colorName: keyof typeof Colors.light & keyof typeof Colors.dark
|
|
12
|
-
) {
|
|
13
|
-
const theme = useColorScheme() ?? 'light';
|
|
14
|
-
const colorFromProps = props[theme];
|
|
15
|
-
|
|
16
|
-
if (colorFromProps) {
|
|
17
|
-
return colorFromProps;
|
|
18
|
-
} else {
|
|
19
|
-
return Colors[theme][colorName];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const { getDefaultConfig } = require('@react-native/metro-config');
|
|
3
|
-
|
|
4
|
-
const projectRoot = __dirname;
|
|
5
|
-
const packageRoot = path.resolve(projectRoot, '../..');
|
|
6
|
-
const workspaceRoot = path.resolve(projectRoot, '../../../..');
|
|
7
|
-
|
|
8
|
-
const config = getDefaultConfig(projectRoot);
|
|
9
|
-
|
|
10
|
-
// Ensure Metro resolves symlinked packages
|
|
11
|
-
config.watchFolders = [...config.watchFolders, workspaceRoot];
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// Allow Metro to resolve packages from the root node_modules and your lib’s node_modules
|
|
15
|
-
config.resolver.nodeModulesPaths = [
|
|
16
|
-
path.resolve(projectRoot, 'node_modules'),
|
|
17
|
-
path.resolve(packageRoot, 'node_modules'),
|
|
18
|
-
path.resolve(workspaceRoot, 'node_modules'),
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
// If your lib is TypeScript/JS, you may need this too:
|
|
22
|
-
if (!config.resolver.sourceExts.includes('cjs')) {
|
|
23
|
-
config.resolver.sourceExts.push('cjs');
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
module.exports = config;
|