create-croissant 0.1.47 → 0.1.48
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/package.json +1 -1
- package/template/apps/platform/src/routes/api/auth/$.ts +1 -1
- package/template/apps/platform/src/routes/api/rpc.$.ts +2 -2
- package/template/package.json +2 -7
- package/template/tsconfig.json +1 -2
- package/template/apps/mobile/.vscode/extensions.json +0 -1
- package/template/apps/mobile/.vscode/settings.json +0 -7
- package/template/apps/mobile/README.md +0 -50
- package/template/apps/mobile/app/(tabs)/_layout.tsx +0 -43
- package/template/apps/mobile/app/(tabs)/account.tsx +0 -147
- package/template/apps/mobile/app/(tabs)/explore.tsx +0 -345
- package/template/apps/mobile/app/(tabs)/index.tsx +0 -112
- package/template/apps/mobile/app/_layout.tsx +0 -43
- package/template/apps/mobile/app/index.tsx +0 -129
- package/template/apps/mobile/app/login.tsx +0 -135
- package/template/apps/mobile/app/signup.tsx +0 -144
- package/template/apps/mobile/app.json +0 -56
- package/template/apps/mobile/assets/images/android-icon-background.png +0 -0
- package/template/apps/mobile/assets/images/android-icon-foreground.png +0 -0
- package/template/apps/mobile/assets/images/android-icon-monochrome.png +0 -0
- package/template/apps/mobile/assets/images/favicon.png +0 -0
- package/template/apps/mobile/assets/images/icon.png +0 -0
- package/template/apps/mobile/assets/images/partial-react-logo.png +0 -0
- package/template/apps/mobile/assets/images/react-logo.png +0 -0
- package/template/apps/mobile/assets/images/react-logo@2x.png +0 -0
- package/template/apps/mobile/assets/images/react-logo@3x.png +0 -0
- package/template/apps/mobile/assets/images/splash-icon.png +0 -0
- package/template/apps/mobile/components/external-link.tsx +0 -25
- package/template/apps/mobile/components/haptic-tab.tsx +0 -18
- package/template/apps/mobile/components/hello-wave.tsx +0 -20
- package/template/apps/mobile/components/parallax-scroll-view.tsx +0 -81
- package/template/apps/mobile/components/themed-text.tsx +0 -60
- package/template/apps/mobile/components/themed-view.tsx +0 -14
- package/template/apps/mobile/components/ui/button.tsx +0 -86
- package/template/apps/mobile/components/ui/collapsible.tsx +0 -46
- package/template/apps/mobile/components/ui/icon-symbol.ios.tsx +0 -32
- package/template/apps/mobile/components/ui/icon-symbol.tsx +0 -41
- package/template/apps/mobile/components/ui/input.tsx +0 -56
- package/template/apps/mobile/constants/theme.ts +0 -53
- package/template/apps/mobile/hooks/use-color-scheme.ts +0 -1
- package/template/apps/mobile/hooks/use-color-scheme.web.ts +0 -21
- package/template/apps/mobile/hooks/use-theme-color.ts +0 -21
- package/template/apps/mobile/lib/auth-client.ts +0 -14
- package/template/apps/mobile/lib/orpc.ts +0 -28
- package/template/apps/mobile/package.json +0 -57
- package/template/apps/mobile/scripts/reset-project.js +0 -112
- package/template/apps/mobile/tsconfig.json +0 -13
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import Animated from "react-native-reanimated";
|
|
2
|
-
|
|
3
|
-
export function HelloWave() {
|
|
4
|
-
return (
|
|
5
|
-
<Animated.Text
|
|
6
|
-
style={{
|
|
7
|
-
fontSize: 28,
|
|
8
|
-
lineHeight: 32,
|
|
9
|
-
marginTop: -6,
|
|
10
|
-
animationName: {
|
|
11
|
-
"50%": { transform: [{ rotate: "25deg" }] },
|
|
12
|
-
},
|
|
13
|
-
animationIterationCount: 4,
|
|
14
|
-
animationDuration: "300ms",
|
|
15
|
-
}}
|
|
16
|
-
>
|
|
17
|
-
👋
|
|
18
|
-
</Animated.Text>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
@@ -1,81 +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
|
-
useScrollOffset,
|
|
8
|
-
} from "react-native-reanimated";
|
|
9
|
-
|
|
10
|
-
import { ThemedView } from "@/components/themed-view";
|
|
11
|
-
import { useColorScheme } from "@/hooks/use-color-scheme";
|
|
12
|
-
import { useThemeColor } from "@/hooks/use-theme-color";
|
|
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 backgroundColor = useThemeColor({}, "background");
|
|
27
|
-
const colorScheme = useColorScheme() ?? "light";
|
|
28
|
-
const scrollRef = useAnimatedRef<Animated.ScrollView>();
|
|
29
|
-
const scrollOffset = useScrollOffset(scrollRef);
|
|
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
|
-
<Animated.ScrollView
|
|
49
|
-
ref={scrollRef}
|
|
50
|
-
style={{ backgroundColor, flex: 1 }}
|
|
51
|
-
scrollEventThrottle={16}
|
|
52
|
-
>
|
|
53
|
-
<Animated.View
|
|
54
|
-
style={[
|
|
55
|
-
styles.header,
|
|
56
|
-
{ backgroundColor: headerBackgroundColor[colorScheme] },
|
|
57
|
-
headerAnimatedStyle,
|
|
58
|
-
]}
|
|
59
|
-
>
|
|
60
|
-
{headerImage}
|
|
61
|
-
</Animated.View>
|
|
62
|
-
<ThemedView style={styles.content}>{children}</ThemedView>
|
|
63
|
-
</Animated.ScrollView>
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const styles = StyleSheet.create({
|
|
68
|
-
container: {
|
|
69
|
-
flex: 1,
|
|
70
|
-
},
|
|
71
|
-
header: {
|
|
72
|
-
height: HEADER_HEIGHT,
|
|
73
|
-
overflow: "hidden",
|
|
74
|
-
},
|
|
75
|
-
content: {
|
|
76
|
-
flex: 1,
|
|
77
|
-
padding: 32,
|
|
78
|
-
gap: 16,
|
|
79
|
-
overflow: "hidden",
|
|
80
|
-
},
|
|
81
|
-
});
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { StyleSheet, Text, type TextProps } from "react-native";
|
|
2
|
-
|
|
3
|
-
import { useThemeColor } from "@/hooks/use-theme-color";
|
|
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/use-theme-color";
|
|
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,86 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { TouchableOpacity, Text, StyleSheet, ActivityIndicator, ViewStyle, StyleProp } from "react-native";
|
|
3
|
-
|
|
4
|
-
interface ButtonProps {
|
|
5
|
-
onPress: () => void;
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
loading?: boolean;
|
|
9
|
-
variant?: "primary" | "secondary" | "outline" | "destructive";
|
|
10
|
-
style?: StyleProp<ViewStyle>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function Button({
|
|
14
|
-
onPress,
|
|
15
|
-
children,
|
|
16
|
-
disabled,
|
|
17
|
-
loading,
|
|
18
|
-
variant = "primary",
|
|
19
|
-
style
|
|
20
|
-
}: ButtonProps) {
|
|
21
|
-
const containerStyle = [
|
|
22
|
-
styles.button,
|
|
23
|
-
styles[variant],
|
|
24
|
-
disabled && styles.disabled,
|
|
25
|
-
style,
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
const textStyle = [
|
|
29
|
-
styles.text,
|
|
30
|
-
variant === "outline" && styles.outlineText,
|
|
31
|
-
disabled && styles.disabledText,
|
|
32
|
-
];
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<TouchableOpacity
|
|
36
|
-
style={containerStyle}
|
|
37
|
-
onPress={onPress}
|
|
38
|
-
disabled={disabled || loading}
|
|
39
|
-
>
|
|
40
|
-
{loading ? (
|
|
41
|
-
<ActivityIndicator color={variant === "outline" ? "#000" : "#fff"} />
|
|
42
|
-
) : (
|
|
43
|
-
<Text style={textStyle}>{children}</Text>
|
|
44
|
-
)}
|
|
45
|
-
</TouchableOpacity>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const styles = StyleSheet.create({
|
|
50
|
-
button: {
|
|
51
|
-
height: 48,
|
|
52
|
-
borderRadius: 8,
|
|
53
|
-
justifyContent: "center",
|
|
54
|
-
alignItems: "center",
|
|
55
|
-
paddingHorizontal: 16,
|
|
56
|
-
},
|
|
57
|
-
primary: {
|
|
58
|
-
backgroundColor: "#000",
|
|
59
|
-
},
|
|
60
|
-
secondary: {
|
|
61
|
-
backgroundColor: "#f0f0f0",
|
|
62
|
-
},
|
|
63
|
-
outline: {
|
|
64
|
-
backgroundColor: "transparent",
|
|
65
|
-
borderWidth: 1,
|
|
66
|
-
borderColor: "#e0e0e0",
|
|
67
|
-
},
|
|
68
|
-
destructive: {
|
|
69
|
-
backgroundColor: "#ef4444",
|
|
70
|
-
},
|
|
71
|
-
disabled: {
|
|
72
|
-
backgroundColor: "#ccc",
|
|
73
|
-
borderColor: "#ccc",
|
|
74
|
-
},
|
|
75
|
-
text: {
|
|
76
|
-
color: "#fff",
|
|
77
|
-
fontSize: 16,
|
|
78
|
-
fontWeight: "600",
|
|
79
|
-
},
|
|
80
|
-
outlineText: {
|
|
81
|
-
color: "#000",
|
|
82
|
-
},
|
|
83
|
-
disabledText: {
|
|
84
|
-
color: "#999",
|
|
85
|
-
},
|
|
86
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren, useState } from "react";
|
|
2
|
-
import { StyleSheet, TouchableOpacity } from "react-native";
|
|
3
|
-
|
|
4
|
-
import { ThemedText } from "@/components/themed-text";
|
|
5
|
-
import { ThemedView } from "@/components/themed-view";
|
|
6
|
-
import { IconSymbol } from "@/components/ui/icon-symbol";
|
|
7
|
-
import { Colors } from "@/constants/theme";
|
|
8
|
-
import { useColorScheme } from "@/hooks/use-color-scheme";
|
|
9
|
-
|
|
10
|
-
export function Collapsible({ children, title }: PropsWithChildren & { title: string }) {
|
|
11
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
12
|
-
const theme = useColorScheme() ?? "light";
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<ThemedView>
|
|
16
|
-
<TouchableOpacity
|
|
17
|
-
style={styles.heading}
|
|
18
|
-
onPress={() => setIsOpen((value) => !value)}
|
|
19
|
-
activeOpacity={0.8}
|
|
20
|
-
>
|
|
21
|
-
<IconSymbol
|
|
22
|
-
name="chevron.right"
|
|
23
|
-
size={18}
|
|
24
|
-
weight="medium"
|
|
25
|
-
color={theme === "light" ? Colors.light.icon : Colors.dark.icon}
|
|
26
|
-
style={{ transform: [{ rotate: isOpen ? "90deg" : "0deg" }] }}
|
|
27
|
-
/>
|
|
28
|
-
|
|
29
|
-
<ThemedText type="defaultSemiBold">{title}</ThemedText>
|
|
30
|
-
</TouchableOpacity>
|
|
31
|
-
{isOpen && <ThemedView style={styles.content}>{children}</ThemedView>}
|
|
32
|
-
</ThemedView>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const styles = StyleSheet.create({
|
|
37
|
-
heading: {
|
|
38
|
-
flexDirection: "row",
|
|
39
|
-
alignItems: "center",
|
|
40
|
-
gap: 6,
|
|
41
|
-
},
|
|
42
|
-
content: {
|
|
43
|
-
marginTop: 6,
|
|
44
|
-
marginLeft: 24,
|
|
45
|
-
},
|
|
46
|
-
});
|
|
@@ -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,56 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { TextInput, StyleSheet, TextInputProps, View, Text } from "react-native";
|
|
3
|
-
|
|
4
|
-
interface InputProps extends TextInputProps {
|
|
5
|
-
label?: string;
|
|
6
|
-
error?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function Input({ label, error, style, ...props }: InputProps) {
|
|
10
|
-
return (
|
|
11
|
-
<View style={styles.container}>
|
|
12
|
-
{label && <Text style={styles.label}>{label}</Text>}
|
|
13
|
-
<TextInput
|
|
14
|
-
style={[
|
|
15
|
-
styles.input,
|
|
16
|
-
error && styles.inputError,
|
|
17
|
-
style,
|
|
18
|
-
]}
|
|
19
|
-
placeholderTextColor="#999"
|
|
20
|
-
{...props}
|
|
21
|
-
/>
|
|
22
|
-
{error && <Text style={styles.errorText}>{error}</Text>}
|
|
23
|
-
</View>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const styles = StyleSheet.create({
|
|
28
|
-
container: {
|
|
29
|
-
width: "100%",
|
|
30
|
-
marginBottom: 16,
|
|
31
|
-
},
|
|
32
|
-
label: {
|
|
33
|
-
fontSize: 14,
|
|
34
|
-
fontWeight: "500",
|
|
35
|
-
marginBottom: 8,
|
|
36
|
-
color: "#333",
|
|
37
|
-
},
|
|
38
|
-
input: {
|
|
39
|
-
height: 48,
|
|
40
|
-
borderWidth: 1,
|
|
41
|
-
borderColor: "#e0e0e0",
|
|
42
|
-
borderRadius: 8,
|
|
43
|
-
paddingHorizontal: 12,
|
|
44
|
-
fontSize: 16,
|
|
45
|
-
color: "#000",
|
|
46
|
-
backgroundColor: "#fff",
|
|
47
|
-
},
|
|
48
|
-
inputError: {
|
|
49
|
-
borderColor: "#ff4444",
|
|
50
|
-
},
|
|
51
|
-
errorText: {
|
|
52
|
-
color: "#ff4444",
|
|
53
|
-
fontSize: 12,
|
|
54
|
-
marginTop: 4,
|
|
55
|
-
},
|
|
56
|
-
});
|
|
@@ -1,53 +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
|
-
import { Platform } from "react-native";
|
|
7
|
-
|
|
8
|
-
const tintColorLight = "#0a7ea4";
|
|
9
|
-
const tintColorDark = "#fff";
|
|
10
|
-
|
|
11
|
-
export const Colors = {
|
|
12
|
-
light: {
|
|
13
|
-
text: "#11181C",
|
|
14
|
-
background: "#fff",
|
|
15
|
-
tint: tintColorLight,
|
|
16
|
-
icon: "#687076",
|
|
17
|
-
tabIconDefault: "#687076",
|
|
18
|
-
tabIconSelected: tintColorLight,
|
|
19
|
-
},
|
|
20
|
-
dark: {
|
|
21
|
-
text: "#ECEDEE",
|
|
22
|
-
background: "#151718",
|
|
23
|
-
tint: tintColorDark,
|
|
24
|
-
icon: "#9BA1A6",
|
|
25
|
-
tabIconDefault: "#9BA1A6",
|
|
26
|
-
tabIconSelected: tintColorDark,
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const Fonts = Platform.select({
|
|
31
|
-
ios: {
|
|
32
|
-
/** iOS `UIFontDescriptorSystemDesignDefault` */
|
|
33
|
-
sans: "system-ui",
|
|
34
|
-
/** iOS `UIFontDescriptorSystemDesignSerif` */
|
|
35
|
-
serif: "ui-serif",
|
|
36
|
-
/** iOS `UIFontDescriptorSystemDesignRounded` */
|
|
37
|
-
rounded: "ui-rounded",
|
|
38
|
-
/** iOS `UIFontDescriptorSystemDesignMonospaced` */
|
|
39
|
-
mono: "ui-monospace",
|
|
40
|
-
},
|
|
41
|
-
default: {
|
|
42
|
-
sans: "normal",
|
|
43
|
-
serif: "serif",
|
|
44
|
-
rounded: "normal",
|
|
45
|
-
mono: "monospace",
|
|
46
|
-
},
|
|
47
|
-
web: {
|
|
48
|
-
sans: "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",
|
|
49
|
-
serif: "Georgia, 'Times New Roman', serif",
|
|
50
|
-
rounded: "'SF Pro Rounded', 'Hiragino Maru Gothic ProN', Meiryo, 'MS PGothic', sans-serif",
|
|
51
|
-
mono: "SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
|
|
52
|
-
},
|
|
53
|
-
});
|
|
@@ -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/theme";
|
|
7
|
-
import { useColorScheme } from "@/hooks/use-color-scheme";
|
|
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,14 +0,0 @@
|
|
|
1
|
-
import { createAuthClient } from "better-auth/react";
|
|
2
|
-
import { expoClient } from "@better-auth/expo/client";
|
|
3
|
-
import * as SecureStore from "expo-secure-store";
|
|
4
|
-
|
|
5
|
-
export const authClient = createAuthClient({
|
|
6
|
-
baseURL: process.env.EXPO_PUBLIC_BETTER_AUTH_URL || "https://platform.local",
|
|
7
|
-
plugins: [
|
|
8
|
-
expoClient({
|
|
9
|
-
scheme: "mobile",
|
|
10
|
-
storagePrefix: "mobile",
|
|
11
|
-
storage: SecureStore,
|
|
12
|
-
}),
|
|
13
|
-
],
|
|
14
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { createORPCClient } from '@orpc/client'
|
|
2
|
-
import { RPCLink } from '@orpc/client/fetch'
|
|
3
|
-
import { RouterClient } from '@orpc/server'
|
|
4
|
-
import { router } from '@workspace/orpc/router'
|
|
5
|
-
import { authClient } from './auth-client'
|
|
6
|
-
|
|
7
|
-
export const link = new RPCLink({
|
|
8
|
-
url: `https://platform.local/api/rpc`,
|
|
9
|
-
async fetch(request, init) {
|
|
10
|
-
const { fetch } = await import('expo/fetch')
|
|
11
|
-
const headers = new Map<string, string>();
|
|
12
|
-
const cookies = authClient.getCookie();
|
|
13
|
-
if (cookies) {
|
|
14
|
-
headers.set("Cookie", cookies);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const resp = await fetch(request.url, {
|
|
18
|
-
body: request.body,
|
|
19
|
-
headers: Object.fromEntries(headers),
|
|
20
|
-
method: request.method,
|
|
21
|
-
...init,
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
return resp
|
|
25
|
-
},
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
export const orpc: RouterClient<typeof router> = createORPCClient(link)
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "mobile",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"main": "expo-router/entry",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "expo start",
|
|
8
|
-
"start": "expo start",
|
|
9
|
-
"reset-project": "node ./scripts/reset-project.js",
|
|
10
|
-
"android": "expo start --android",
|
|
11
|
-
"ios": "expo start --ios",
|
|
12
|
-
"web": "expo start --web",
|
|
13
|
-
"build": "expo export --output-dir .output"
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@better-auth/expo": "^1.6.9",
|
|
17
|
-
"@expo/vector-icons": "^15.0.3",
|
|
18
|
-
"@orpc/client": "^1.14.0",
|
|
19
|
-
"@orpc/server": "^1.14.0",
|
|
20
|
-
"@orpc/tanstack-query": "^1.14.0",
|
|
21
|
-
"@react-navigation/bottom-tabs": "^7.4.0",
|
|
22
|
-
"@react-navigation/elements": "^2.6.3",
|
|
23
|
-
"@react-navigation/native": "^7.1.8",
|
|
24
|
-
"@tanstack/react-form": "^1.29.1",
|
|
25
|
-
"@tanstack/react-query": "^5.100.5",
|
|
26
|
-
"@workspace/orpc": "workspace:*",
|
|
27
|
-
"@workspace/ui": "workspace:*",
|
|
28
|
-
"better-auth": "^1.6.9",
|
|
29
|
-
"expo": "^55.0.17",
|
|
30
|
-
"expo-constants": "~55.0.15",
|
|
31
|
-
"expo-font": "~55.0.6",
|
|
32
|
-
"expo-haptics": "~55.0.14",
|
|
33
|
-
"expo-image": "~55.0.9",
|
|
34
|
-
"expo-linking": "~55.0.14",
|
|
35
|
-
"expo-network": "^55.0.13",
|
|
36
|
-
"expo-router": "~55.0.13",
|
|
37
|
-
"expo-secure-store": "^55.0.13",
|
|
38
|
-
"expo-splash-screen": "~55.0.19",
|
|
39
|
-
"expo-status-bar": "~55.0.5",
|
|
40
|
-
"expo-symbols": "~55.0.7",
|
|
41
|
-
"expo-system-ui": "~55.0.16",
|
|
42
|
-
"expo-web-browser": "~55.0.14",
|
|
43
|
-
"react": "19.2.5",
|
|
44
|
-
"react-dom": "19.2.5",
|
|
45
|
-
"react-native": "0.83.6",
|
|
46
|
-
"react-native-gesture-handler": "~2.30.0",
|
|
47
|
-
"react-native-reanimated": "4.2.1",
|
|
48
|
-
"react-native-safe-area-context": "~5.6.0",
|
|
49
|
-
"react-native-screens": "~4.23.0",
|
|
50
|
-
"react-native-web": "~0.21.0",
|
|
51
|
-
"react-native-worklets": "0.7.4"
|
|
52
|
-
},
|
|
53
|
-
"devDependencies": {
|
|
54
|
-
"babel-plugin-transform-import-meta": "^2.3.3",
|
|
55
|
-
"metro-react-native-babel-transformer": "^0.77.0"
|
|
56
|
-
}
|
|
57
|
-
}
|