create-croissant 0.1.38 → 0.1.40
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 +9 -9
- package/template/README.md +4 -4
- package/template/apps/desktop/electron-builder.yml +6 -6
- package/template/apps/desktop/electron.vite.config.ts +8 -8
- package/template/apps/desktop/package.json +5 -5
- package/template/apps/desktop/src/main/index.ts +32 -32
- package/template/apps/desktop/src/preload/index.d.ts +3 -3
- package/template/apps/desktop/src/preload/index.ts +8 -8
- package/template/apps/desktop/src/renderer/src/App.tsx +5 -5
- package/template/apps/desktop/src/renderer/src/assets/base.css +4 -4
- package/template/apps/desktop/src/renderer/src/assets/main.css +3 -3
- package/template/apps/desktop/src/renderer/src/components/Versions.tsx +4 -4
- package/template/apps/desktop/src/renderer/src/main.tsx +7 -7
- package/template/apps/desktop/tsconfig.json +1 -4
- package/template/apps/desktop/tsconfig.node.json +7 -1
- package/template/apps/desktop/tsconfig.web.json +3 -9
- package/template/apps/mobile/app/(tabs)/_layout.tsx +11 -10
- package/template/apps/mobile/app/(tabs)/explore.tsx +29 -27
- package/template/apps/mobile/app/(tabs)/index.tsx +25 -24
- package/template/apps/mobile/app/_layout.tsx +8 -8
- package/template/apps/mobile/app/modal.tsx +6 -6
- package/template/apps/mobile/components/external-link.tsx +5 -5
- package/template/apps/mobile/components/haptic-tab.tsx +4 -4
- package/template/apps/mobile/components/hello-wave.tsx +5 -4
- package/template/apps/mobile/components/parallax-scroll-view.tsx +15 -13
- package/template/apps/mobile/components/themed-text.tsx +14 -14
- package/template/apps/mobile/components/themed-view.tsx +3 -3
- package/template/apps/mobile/components/ui/collapsible.tsx +14 -13
- package/template/apps/mobile/components/ui/icon-symbol.ios.tsx +4 -4
- package/template/apps/mobile/components/ui/icon-symbol.tsx +9 -9
- package/template/apps/mobile/constants/theme.ts +19 -19
- package/template/apps/mobile/hooks/use-color-scheme.ts +1 -1
- package/template/apps/mobile/hooks/use-color-scheme.web.ts +3 -3
- package/template/apps/mobile/hooks/use-theme-color.ts +4 -4
- package/template/apps/mobile/package.json +3 -3
- package/template/apps/mobile/scripts/reset-project.js +2 -2
- package/template/apps/mobile/tsconfig.json +2 -9
- package/template/apps/platform/drizzle.config.ts +5 -5
- package/template/apps/platform/package.json +4 -4
- package/template/apps/platform/src/components/app-sidebar.tsx +60 -69
- package/template/apps/platform/src/components/login-form.tsx +32 -39
- package/template/apps/platform/src/components/search-form.tsx +5 -13
- package/template/apps/platform/src/components/signup-form.tsx +39 -49
- package/template/apps/platform/src/components/version-switcher.tsx +11 -21
- package/template/apps/platform/src/lib/auth-utils.ts +12 -14
- package/template/apps/platform/src/lib/orpc.ts +17 -17
- package/template/apps/platform/src/router.tsx +5 -5
- package/template/apps/platform/src/routes/__root.tsx +13 -15
- package/template/apps/platform/src/routes/_auth/account.tsx +61 -50
- package/template/apps/platform/src/routes/_auth/dashboard.tsx +17 -17
- package/template/apps/platform/src/routes/_auth/examples/client-orpc-auth.tsx +13 -13
- package/template/apps/platform/src/routes/_auth/examples/ssr-orpc-auth.tsx +16 -16
- package/template/apps/platform/src/routes/_auth.tsx +5 -5
- package/template/apps/platform/src/routes/_public/examples/client-orpc.tsx +108 -88
- package/template/apps/platform/src/routes/_public/examples/isr.tsx +14 -14
- package/template/apps/platform/src/routes/_public/examples/ssr-orpc.tsx +92 -75
- package/template/apps/platform/src/routes/_public/index.tsx +22 -19
- package/template/apps/platform/src/routes/_public/login.tsx +4 -4
- package/template/apps/platform/src/routes/_public/signup.tsx +6 -5
- package/template/apps/platform/src/routes/_public.tsx +5 -5
- package/template/apps/platform/src/routes/api/auth/$.ts +13 -13
- package/template/apps/platform/src/routes/api/rpc.$.ts +13 -13
- package/template/apps/platform/vite.config.ts +8 -8
- package/template/docker-compose.yml +1 -1
- package/template/package.json +24 -26
- package/template/packages/auth/package.json +9 -9
- package/template/packages/auth/src/lib/auth.ts +1 -1
- package/template/packages/db/package.json +7 -7
- package/template/packages/db/src/index.ts +4 -4
- package/template/packages/db/src/schema.ts +2 -2
- package/template/packages/orpc/package.json +6 -6
- package/template/packages/orpc/src/lib/planets.ts +39 -43
- package/template/packages/orpc/src/lib/router.ts +15 -15
- package/template/packages/ui/package.json +10 -10
- package/template/packages/ui/src/components/accordion.tsx +20 -22
- package/template/packages/ui/src/components/alert-dialog.tsx +31 -56
- package/template/packages/ui/src/components/alert.tsx +15 -23
- package/template/packages/ui/src/components/aspect-ratio.tsx +3 -3
- package/template/packages/ui/src/components/avatar.tsx +19 -35
- package/template/packages/ui/src/components/badge.tsx +13 -17
- package/template/packages/ui/src/components/breadcrumb.tsx +22 -44
- package/template/packages/ui/src/components/button-group.tsx +16 -25
- package/template/packages/ui/src/components/button.tsx +8 -9
- package/template/packages/ui/src/components/calendar.tsx +43 -82
- package/template/packages/ui/src/components/card.tsx +15 -26
- package/template/packages/ui/src/components/carousel.tsx +70 -78
- package/template/packages/ui/src/components/chart.tsx +84 -117
- package/template/packages/ui/src/components/checkbox.tsx +8 -9
- package/template/packages/ui/src/components/collapsible.tsx +5 -9
- package/template/packages/ui/src/components/combobox.tsx +44 -68
- package/template/packages/ui/src/components/command.tsx +32 -47
- package/template/packages/ui/src/components/context-menu.tsx +45 -71
- package/template/packages/ui/src/components/dialog.tsx +29 -51
- package/template/packages/ui/src/components/direction.tsx +1 -4
- package/template/packages/ui/src/components/drawer.tsx +24 -38
- package/template/packages/ui/src/components/dropdown-menu.tsx +45 -55
- package/template/packages/ui/src/components/empty.tsx +16 -27
- package/template/packages/ui/src/components/field.tsx +49 -63
- package/template/packages/ui/src/components/hover-card.tsx +9 -14
- package/template/packages/ui/src/components/input-group.tsx +40 -52
- package/template/packages/ui/src/components/input-otp.tsx +17 -18
- package/template/packages/ui/src/components/input.tsx +6 -6
- package/template/packages/ui/src/components/item.tsx +31 -44
- package/template/packages/ui/src/components/kbd.tsx +5 -5
- package/template/packages/ui/src/components/label.tsx +6 -6
- package/template/packages/ui/src/components/menubar.tsx +51 -64
- package/template/packages/ui/src/components/mode-toggle.tsx +9 -15
- package/template/packages/ui/src/components/native-select.tsx +18 -24
- package/template/packages/ui/src/components/navigation-menu.tsx +28 -35
- package/template/packages/ui/src/components/pagination.tsx +19 -31
- package/template/packages/ui/src/components/popover.tsx +13 -26
- package/template/packages/ui/src/components/progress.tsx +13 -30
- package/template/packages/ui/src/components/radio-group.tsx +7 -7
- package/template/packages/ui/src/components/resizable.tsx +12 -20
- package/template/packages/ui/src/components/scroll-area.tsx +8 -12
- package/template/packages/ui/src/components/select.tsx +31 -42
- package/template/packages/ui/src/components/separator.tsx +6 -10
- package/template/packages/ui/src/components/sheet.tsx +25 -38
- package/template/packages/ui/src/components/sidebar.tsx +137 -170
- package/template/packages/ui/src/components/skeleton.tsx +3 -3
- package/template/packages/ui/src/components/slider.tsx +5 -5
- package/template/packages/ui/src/components/sonner.tsx +20 -24
- package/template/packages/ui/src/components/spinner.tsx +10 -5
- package/template/packages/ui/src/components/switch.tsx +6 -6
- package/template/packages/ui/src/components/table.tsx +18 -45
- package/template/packages/ui/src/components/tabs.tsx +14 -22
- package/template/packages/ui/src/components/textarea.tsx +5 -5
- package/template/packages/ui/src/components/theme-provider.tsx +43 -48
- package/template/packages/ui/src/components/toggle-group.tsx +18 -20
- package/template/packages/ui/src/components/toggle.tsx +9 -10
- package/template/packages/ui/src/components/tooltip.tsx +10 -22
- package/template/packages/ui/src/hooks/use-mobile.ts +11 -11
- package/template/packages/ui/src/lib/utils.ts +4 -4
- package/template/packages/ui/src/styles/globals.css +106 -106
- package/template/turbo.json +15 -6
- package/template/.prettierignore +0 -10
- package/template/apps/desktop/.prettierignore +0 -6
- package/template/apps/desktop/eslint.config.ts +0 -11
- package/template/apps/desktop/prettier.config.ts +0 -3
- package/template/apps/mobile/eslint.config.js +0 -10
- package/template/apps/platform/eslint.config.ts +0 -11
- package/template/apps/platform/prettier.config.ts +0 -3
- package/template/packages/auth/eslint.config.ts +0 -3
- package/template/packages/auth/prettier.config.ts +0 -3
- package/template/packages/config-eslint/index.ts +0 -24
- package/template/packages/config-eslint/package.json +0 -11
- package/template/packages/config-prettier/index.ts +0 -14
- package/template/packages/config-prettier/package.json +0 -7
- package/template/packages/db/eslint.config.ts +0 -3
- package/template/packages/db/prettier.config.ts +0 -3
- package/template/packages/orpc/eslint.config.ts +0 -3
- package/template/packages/orpc/prettier.config.ts +0 -3
- package/template/packages/ui/eslint.config.ts +0 -3
- package/template/packages/ui/prettier.config.ts +0 -3
- package/template/prettier.config.ts +0 -15
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { Image } from
|
|
2
|
-
import { Platform, StyleSheet } from
|
|
1
|
+
import { Image } from "expo-image";
|
|
2
|
+
import { Platform, StyleSheet } from "react-native";
|
|
3
3
|
|
|
4
|
-
import { HelloWave } from
|
|
5
|
-
import ParallaxScrollView from
|
|
6
|
-
import { ThemedText } from
|
|
7
|
-
import { ThemedView } from
|
|
8
|
-
import { Link } from
|
|
4
|
+
import { HelloWave } from "@/components/hello-wave";
|
|
5
|
+
import ParallaxScrollView from "@/components/parallax-scroll-view";
|
|
6
|
+
import { ThemedText } from "@/components/themed-text";
|
|
7
|
+
import { ThemedView } from "@/components/themed-view";
|
|
8
|
+
import { Link } from "expo-router";
|
|
9
9
|
|
|
10
10
|
export default function HomeScreen() {
|
|
11
11
|
return (
|
|
12
12
|
<ParallaxScrollView
|
|
13
|
-
headerBackgroundColor={{ light:
|
|
13
|
+
headerBackgroundColor={{ light: "#A1CEDC", dark: "#1D3D47" }}
|
|
14
14
|
headerImage={
|
|
15
15
|
<Image
|
|
16
|
-
source={require(
|
|
16
|
+
source={require("@/assets/images/partial-react-logo.png")}
|
|
17
17
|
style={styles.reactLogo}
|
|
18
18
|
/>
|
|
19
|
-
}
|
|
19
|
+
}
|
|
20
|
+
>
|
|
20
21
|
<ThemedView style={styles.titleContainer}>
|
|
21
22
|
<ThemedText type="title">Welcome!</ThemedText>
|
|
22
23
|
<HelloWave />
|
|
@@ -25,14 +26,14 @@ export default function HomeScreen() {
|
|
|
25
26
|
<ThemedText type="subtitle">Step 1: Try it</ThemedText>
|
|
26
27
|
<ThemedText>
|
|
27
28
|
Edit <ThemedText type="defaultSemiBold">app/(tabs)/index.tsx</ThemedText> to see changes.
|
|
28
|
-
Press{
|
|
29
|
+
Press{" "}
|
|
29
30
|
<ThemedText type="defaultSemiBold">
|
|
30
31
|
{Platform.select({
|
|
31
|
-
ios:
|
|
32
|
-
android:
|
|
33
|
-
web:
|
|
32
|
+
ios: "cmd + d",
|
|
33
|
+
android: "cmd + m",
|
|
34
|
+
web: "F12",
|
|
34
35
|
})}
|
|
35
|
-
</ThemedText>{
|
|
36
|
+
</ThemedText>{" "}
|
|
36
37
|
to open developer tools.
|
|
37
38
|
</ThemedText>
|
|
38
39
|
</ThemedView>
|
|
@@ -43,18 +44,18 @@ export default function HomeScreen() {
|
|
|
43
44
|
</Link.Trigger>
|
|
44
45
|
<Link.Preview />
|
|
45
46
|
<Link.Menu>
|
|
46
|
-
<Link.MenuAction title="Action" icon="cube" onPress={() => alert(
|
|
47
|
+
<Link.MenuAction title="Action" icon="cube" onPress={() => alert("Action pressed")} />
|
|
47
48
|
<Link.MenuAction
|
|
48
49
|
title="Share"
|
|
49
50
|
icon="square.and.arrow.up"
|
|
50
|
-
onPress={() => alert(
|
|
51
|
+
onPress={() => alert("Share pressed")}
|
|
51
52
|
/>
|
|
52
53
|
<Link.Menu title="More" icon="ellipsis">
|
|
53
54
|
<Link.MenuAction
|
|
54
55
|
title="Delete"
|
|
55
56
|
icon="trash"
|
|
56
57
|
destructive
|
|
57
|
-
onPress={() => alert(
|
|
58
|
+
onPress={() => alert("Delete pressed")}
|
|
58
59
|
/>
|
|
59
60
|
</Link.Menu>
|
|
60
61
|
</Link.Menu>
|
|
@@ -68,9 +69,9 @@ export default function HomeScreen() {
|
|
|
68
69
|
<ThemedText type="subtitle">Step 3: Get a fresh start</ThemedText>
|
|
69
70
|
<ThemedText>
|
|
70
71
|
{`When you're ready, run `}
|
|
71
|
-
<ThemedText type="defaultSemiBold">npm run reset-project</ThemedText> to get a fresh{
|
|
72
|
-
<ThemedText type="defaultSemiBold">app</ThemedText> directory. This will move the current{
|
|
73
|
-
<ThemedText type="defaultSemiBold">app</ThemedText> to{
|
|
72
|
+
<ThemedText type="defaultSemiBold">npm run reset-project</ThemedText> to get a fresh{" "}
|
|
73
|
+
<ThemedText type="defaultSemiBold">app</ThemedText> directory. This will move the current{" "}
|
|
74
|
+
<ThemedText type="defaultSemiBold">app</ThemedText> to{" "}
|
|
74
75
|
<ThemedText type="defaultSemiBold">app-example</ThemedText>.
|
|
75
76
|
</ThemedText>
|
|
76
77
|
</ThemedView>
|
|
@@ -80,8 +81,8 @@ export default function HomeScreen() {
|
|
|
80
81
|
|
|
81
82
|
const styles = StyleSheet.create({
|
|
82
83
|
titleContainer: {
|
|
83
|
-
flexDirection:
|
|
84
|
-
alignItems:
|
|
84
|
+
flexDirection: "row",
|
|
85
|
+
alignItems: "center",
|
|
85
86
|
gap: 8,
|
|
86
87
|
},
|
|
87
88
|
stepContainer: {
|
|
@@ -93,6 +94,6 @@ const styles = StyleSheet.create({
|
|
|
93
94
|
width: 290,
|
|
94
95
|
bottom: 0,
|
|
95
96
|
left: 0,
|
|
96
|
-
position:
|
|
97
|
+
position: "absolute",
|
|
97
98
|
},
|
|
98
99
|
});
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { DarkTheme, DefaultTheme, ThemeProvider } from
|
|
2
|
-
import { Stack } from
|
|
3
|
-
import { StatusBar } from
|
|
4
|
-
import
|
|
1
|
+
import { DarkTheme, DefaultTheme, ThemeProvider } from "@react-navigation/native";
|
|
2
|
+
import { Stack } from "expo-router";
|
|
3
|
+
import { StatusBar } from "expo-status-bar";
|
|
4
|
+
import "react-native-reanimated";
|
|
5
5
|
|
|
6
|
-
import { useColorScheme } from
|
|
6
|
+
import { useColorScheme } from "@/hooks/use-color-scheme";
|
|
7
7
|
|
|
8
8
|
export const unstable_settings = {
|
|
9
|
-
anchor:
|
|
9
|
+
anchor: "(tabs)",
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export default function RootLayout() {
|
|
13
13
|
const colorScheme = useColorScheme();
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
|
-
<ThemeProvider value={colorScheme ===
|
|
16
|
+
<ThemeProvider value={colorScheme === "dark" ? DarkTheme : DefaultTheme}>
|
|
17
17
|
<Stack>
|
|
18
18
|
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
19
|
-
<Stack.Screen name="modal" options={{ presentation:
|
|
19
|
+
<Stack.Screen name="modal" options={{ presentation: "modal", title: "Modal" }} />
|
|
20
20
|
</Stack>
|
|
21
21
|
<StatusBar style="auto" />
|
|
22
22
|
</ThemeProvider>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Link } from
|
|
2
|
-
import { StyleSheet } from
|
|
1
|
+
import { Link } from "expo-router";
|
|
2
|
+
import { StyleSheet } from "react-native";
|
|
3
3
|
|
|
4
|
-
import { ThemedText } from
|
|
5
|
-
import { ThemedView } from
|
|
4
|
+
import { ThemedText } from "@/components/themed-text";
|
|
5
|
+
import { ThemedView } from "@/components/themed-view";
|
|
6
6
|
|
|
7
7
|
export default function ModalScreen() {
|
|
8
8
|
return (
|
|
@@ -18,8 +18,8 @@ export default function ModalScreen() {
|
|
|
18
18
|
const styles = StyleSheet.create({
|
|
19
19
|
container: {
|
|
20
20
|
flex: 1,
|
|
21
|
-
alignItems:
|
|
22
|
-
justifyContent:
|
|
21
|
+
alignItems: "center",
|
|
22
|
+
justifyContent: "center",
|
|
23
23
|
padding: 20,
|
|
24
24
|
},
|
|
25
25
|
link: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Href, Link } from
|
|
2
|
-
import { openBrowserAsync, WebBrowserPresentationStyle } from
|
|
3
|
-
import { type ComponentProps } from
|
|
1
|
+
import { Href, Link } from "expo-router";
|
|
2
|
+
import { openBrowserAsync, WebBrowserPresentationStyle } from "expo-web-browser";
|
|
3
|
+
import { type ComponentProps } from "react";
|
|
4
4
|
|
|
5
|
-
type Props = Omit<ComponentProps<typeof Link>,
|
|
5
|
+
type Props = Omit<ComponentProps<typeof Link>, "href"> & { href: Href & string };
|
|
6
6
|
|
|
7
7
|
export function ExternalLink({ href, ...rest }: Props) {
|
|
8
8
|
return (
|
|
@@ -11,7 +11,7 @@ export function ExternalLink({ href, ...rest }: Props) {
|
|
|
11
11
|
{...rest}
|
|
12
12
|
href={href}
|
|
13
13
|
onPress={async (event) => {
|
|
14
|
-
if (process.env.EXPO_OS !==
|
|
14
|
+
if (process.env.EXPO_OS !== "web") {
|
|
15
15
|
// Prevent the default behavior of linking to the default browser on native.
|
|
16
16
|
event.preventDefault();
|
|
17
17
|
// Open the link in an in-app browser.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { BottomTabBarButtonProps } from
|
|
2
|
-
import { PlatformPressable } from
|
|
3
|
-
import * as Haptics from
|
|
1
|
+
import { BottomTabBarButtonProps } from "@react-navigation/bottom-tabs";
|
|
2
|
+
import { PlatformPressable } from "@react-navigation/elements";
|
|
3
|
+
import * as Haptics from "expo-haptics";
|
|
4
4
|
|
|
5
5
|
export function HapticTab(props: BottomTabBarButtonProps) {
|
|
6
6
|
return (
|
|
7
7
|
<PlatformPressable
|
|
8
8
|
{...props}
|
|
9
9
|
onPressIn={(ev) => {
|
|
10
|
-
if (process.env.EXPO_OS ===
|
|
10
|
+
if (process.env.EXPO_OS === "ios") {
|
|
11
11
|
// Add a soft haptic feedback when pressing down on the tabs.
|
|
12
12
|
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
|
|
13
13
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Animated from
|
|
1
|
+
import Animated from "react-native-reanimated";
|
|
2
2
|
|
|
3
3
|
export function HelloWave() {
|
|
4
4
|
return (
|
|
@@ -8,11 +8,12 @@ export function HelloWave() {
|
|
|
8
8
|
lineHeight: 32,
|
|
9
9
|
marginTop: -6,
|
|
10
10
|
animationName: {
|
|
11
|
-
|
|
11
|
+
"50%": { transform: [{ rotate: "25deg" }] },
|
|
12
12
|
},
|
|
13
13
|
animationIterationCount: 4,
|
|
14
|
-
animationDuration:
|
|
15
|
-
}}
|
|
14
|
+
animationDuration: "300ms",
|
|
15
|
+
}}
|
|
16
|
+
>
|
|
16
17
|
👋
|
|
17
18
|
</Animated.Text>
|
|
18
19
|
);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { PropsWithChildren, ReactElement } from
|
|
2
|
-
import { StyleSheet } from
|
|
1
|
+
import type { PropsWithChildren, ReactElement } from "react";
|
|
2
|
+
import { StyleSheet } from "react-native";
|
|
3
3
|
import Animated, {
|
|
4
4
|
interpolate,
|
|
5
5
|
useAnimatedRef,
|
|
6
6
|
useAnimatedStyle,
|
|
7
7
|
useScrollOffset,
|
|
8
|
-
} from
|
|
8
|
+
} from "react-native-reanimated";
|
|
9
9
|
|
|
10
|
-
import { ThemedView } from
|
|
11
|
-
import { useColorScheme } from
|
|
12
|
-
import { useThemeColor } from
|
|
10
|
+
import { ThemedView } from "@/components/themed-view";
|
|
11
|
+
import { useColorScheme } from "@/hooks/use-color-scheme";
|
|
12
|
+
import { useThemeColor } from "@/hooks/use-theme-color";
|
|
13
13
|
|
|
14
14
|
const HEADER_HEIGHT = 250;
|
|
15
15
|
|
|
@@ -23,8 +23,8 @@ export default function ParallaxScrollView({
|
|
|
23
23
|
headerImage,
|
|
24
24
|
headerBackgroundColor,
|
|
25
25
|
}: Props) {
|
|
26
|
-
const backgroundColor = useThemeColor({},
|
|
27
|
-
const colorScheme = useColorScheme() ??
|
|
26
|
+
const backgroundColor = useThemeColor({}, "background");
|
|
27
|
+
const colorScheme = useColorScheme() ?? "light";
|
|
28
28
|
const scrollRef = useAnimatedRef<Animated.ScrollView>();
|
|
29
29
|
const scrollOffset = useScrollOffset(scrollRef);
|
|
30
30
|
const headerAnimatedStyle = useAnimatedStyle(() => {
|
|
@@ -34,7 +34,7 @@ export default function ParallaxScrollView({
|
|
|
34
34
|
translateY: interpolate(
|
|
35
35
|
scrollOffset.value,
|
|
36
36
|
[-HEADER_HEIGHT, 0, HEADER_HEIGHT],
|
|
37
|
-
[-HEADER_HEIGHT / 2, 0, HEADER_HEIGHT * 0.75]
|
|
37
|
+
[-HEADER_HEIGHT / 2, 0, HEADER_HEIGHT * 0.75],
|
|
38
38
|
),
|
|
39
39
|
},
|
|
40
40
|
{
|
|
@@ -48,13 +48,15 @@ export default function ParallaxScrollView({
|
|
|
48
48
|
<Animated.ScrollView
|
|
49
49
|
ref={scrollRef}
|
|
50
50
|
style={{ backgroundColor, flex: 1 }}
|
|
51
|
-
scrollEventThrottle={16}
|
|
51
|
+
scrollEventThrottle={16}
|
|
52
|
+
>
|
|
52
53
|
<Animated.View
|
|
53
54
|
style={[
|
|
54
55
|
styles.header,
|
|
55
56
|
{ backgroundColor: headerBackgroundColor[colorScheme] },
|
|
56
57
|
headerAnimatedStyle,
|
|
57
|
-
]}
|
|
58
|
+
]}
|
|
59
|
+
>
|
|
58
60
|
{headerImage}
|
|
59
61
|
</Animated.View>
|
|
60
62
|
<ThemedView style={styles.content}>{children}</ThemedView>
|
|
@@ -68,12 +70,12 @@ const styles = StyleSheet.create({
|
|
|
68
70
|
},
|
|
69
71
|
header: {
|
|
70
72
|
height: HEADER_HEIGHT,
|
|
71
|
-
overflow:
|
|
73
|
+
overflow: "hidden",
|
|
72
74
|
},
|
|
73
75
|
content: {
|
|
74
76
|
flex: 1,
|
|
75
77
|
padding: 32,
|
|
76
78
|
gap: 16,
|
|
77
|
-
overflow:
|
|
79
|
+
overflow: "hidden",
|
|
78
80
|
},
|
|
79
81
|
});
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { StyleSheet, Text, type TextProps } from
|
|
1
|
+
import { StyleSheet, Text, type TextProps } from "react-native";
|
|
2
2
|
|
|
3
|
-
import { useThemeColor } from
|
|
3
|
+
import { useThemeColor } from "@/hooks/use-theme-color";
|
|
4
4
|
|
|
5
5
|
export type ThemedTextProps = TextProps & {
|
|
6
6
|
lightColor?: string;
|
|
7
7
|
darkColor?: string;
|
|
8
|
-
type?:
|
|
8
|
+
type?: "default" | "title" | "defaultSemiBold" | "subtitle" | "link";
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export function ThemedText({
|
|
12
12
|
style,
|
|
13
13
|
lightColor,
|
|
14
14
|
darkColor,
|
|
15
|
-
type =
|
|
15
|
+
type = "default",
|
|
16
16
|
...rest
|
|
17
17
|
}: ThemedTextProps) {
|
|
18
|
-
const color = useThemeColor({ light: lightColor, dark: darkColor },
|
|
18
|
+
const color = useThemeColor({ light: lightColor, dark: darkColor }, "text");
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
21
|
<Text
|
|
22
22
|
style={[
|
|
23
23
|
{ color },
|
|
24
|
-
type ===
|
|
25
|
-
type ===
|
|
26
|
-
type ===
|
|
27
|
-
type ===
|
|
28
|
-
type ===
|
|
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
29
|
style,
|
|
30
30
|
]}
|
|
31
31
|
{...rest}
|
|
@@ -41,20 +41,20 @@ const styles = StyleSheet.create({
|
|
|
41
41
|
defaultSemiBold: {
|
|
42
42
|
fontSize: 16,
|
|
43
43
|
lineHeight: 24,
|
|
44
|
-
fontWeight:
|
|
44
|
+
fontWeight: "600",
|
|
45
45
|
},
|
|
46
46
|
title: {
|
|
47
47
|
fontSize: 32,
|
|
48
|
-
fontWeight:
|
|
48
|
+
fontWeight: "bold",
|
|
49
49
|
lineHeight: 32,
|
|
50
50
|
},
|
|
51
51
|
subtitle: {
|
|
52
52
|
fontSize: 20,
|
|
53
|
-
fontWeight:
|
|
53
|
+
fontWeight: "bold",
|
|
54
54
|
},
|
|
55
55
|
link: {
|
|
56
56
|
lineHeight: 30,
|
|
57
57
|
fontSize: 16,
|
|
58
|
-
color:
|
|
58
|
+
color: "#0a7ea4",
|
|
59
59
|
},
|
|
60
60
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { View, type ViewProps } from
|
|
1
|
+
import { View, type ViewProps } from "react-native";
|
|
2
2
|
|
|
3
|
-
import { useThemeColor } from
|
|
3
|
+
import { useThemeColor } from "@/hooks/use-theme-color";
|
|
4
4
|
|
|
5
5
|
export type ThemedViewProps = ViewProps & {
|
|
6
6
|
lightColor?: string;
|
|
@@ -8,7 +8,7 @@ export type ThemedViewProps = ViewProps & {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export function ThemedView({ style, lightColor, darkColor, ...otherProps }: ThemedViewProps) {
|
|
11
|
-
const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor },
|
|
11
|
+
const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor }, "background");
|
|
12
12
|
|
|
13
13
|
return <View style={[{ backgroundColor }, style]} {...otherProps} />;
|
|
14
14
|
}
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { PropsWithChildren, useState } from
|
|
2
|
-
import { StyleSheet, TouchableOpacity } from
|
|
1
|
+
import { PropsWithChildren, useState } from "react";
|
|
2
|
+
import { StyleSheet, TouchableOpacity } from "react-native";
|
|
3
3
|
|
|
4
|
-
import { ThemedText } from
|
|
5
|
-
import { ThemedView } from
|
|
6
|
-
import { IconSymbol } from
|
|
7
|
-
import { Colors } from
|
|
8
|
-
import { useColorScheme } from
|
|
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
9
|
|
|
10
10
|
export function Collapsible({ children, title }: PropsWithChildren & { title: string }) {
|
|
11
11
|
const [isOpen, setIsOpen] = useState(false);
|
|
12
|
-
const theme = useColorScheme() ??
|
|
12
|
+
const theme = useColorScheme() ?? "light";
|
|
13
13
|
|
|
14
14
|
return (
|
|
15
15
|
<ThemedView>
|
|
16
16
|
<TouchableOpacity
|
|
17
17
|
style={styles.heading}
|
|
18
18
|
onPress={() => setIsOpen((value) => !value)}
|
|
19
|
-
activeOpacity={0.8}
|
|
19
|
+
activeOpacity={0.8}
|
|
20
|
+
>
|
|
20
21
|
<IconSymbol
|
|
21
22
|
name="chevron.right"
|
|
22
23
|
size={18}
|
|
23
24
|
weight="medium"
|
|
24
|
-
color={theme ===
|
|
25
|
-
style={{ transform: [{ rotate: isOpen ?
|
|
25
|
+
color={theme === "light" ? Colors.light.icon : Colors.dark.icon}
|
|
26
|
+
style={{ transform: [{ rotate: isOpen ? "90deg" : "0deg" }] }}
|
|
26
27
|
/>
|
|
27
28
|
|
|
28
29
|
<ThemedText type="defaultSemiBold">{title}</ThemedText>
|
|
@@ -34,8 +35,8 @@ export function Collapsible({ children, title }: PropsWithChildren & { title: st
|
|
|
34
35
|
|
|
35
36
|
const styles = StyleSheet.create({
|
|
36
37
|
heading: {
|
|
37
|
-
flexDirection:
|
|
38
|
-
alignItems:
|
|
38
|
+
flexDirection: "row",
|
|
39
|
+
alignItems: "center",
|
|
39
40
|
gap: 6,
|
|
40
41
|
},
|
|
41
42
|
content: {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { SymbolView, SymbolViewProps, SymbolWeight } from
|
|
2
|
-
import { StyleProp, ViewStyle } from
|
|
1
|
+
import { SymbolView, SymbolViewProps, SymbolWeight } from "expo-symbols";
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
3
3
|
|
|
4
4
|
export function IconSymbol({
|
|
5
5
|
name,
|
|
6
6
|
size = 24,
|
|
7
7
|
color,
|
|
8
8
|
style,
|
|
9
|
-
weight =
|
|
9
|
+
weight = "regular",
|
|
10
10
|
}: {
|
|
11
|
-
name: SymbolViewProps[
|
|
11
|
+
name: SymbolViewProps["name"];
|
|
12
12
|
size?: number;
|
|
13
13
|
color: string;
|
|
14
14
|
style?: StyleProp<ViewStyle>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Fallback for using MaterialIcons on Android and web.
|
|
2
2
|
|
|
3
|
-
import MaterialIcons from
|
|
4
|
-
import { SymbolWeight, SymbolViewProps } from
|
|
5
|
-
import { ComponentProps } from
|
|
6
|
-
import { OpaqueColorValue, type StyleProp, type TextStyle } from
|
|
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
7
|
|
|
8
|
-
type IconMapping = Record<SymbolViewProps[
|
|
8
|
+
type IconMapping = Record<SymbolViewProps["name"], ComponentProps<typeof MaterialIcons>["name"]>;
|
|
9
9
|
type IconSymbolName = keyof typeof MAPPING;
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -14,10 +14,10 @@ type IconSymbolName = keyof typeof MAPPING;
|
|
|
14
14
|
* - see SF Symbols in the [SF Symbols](https://developer.apple.com/sf-symbols/) app.
|
|
15
15
|
*/
|
|
16
16
|
const MAPPING = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
"house.fill": "home",
|
|
18
|
+
"paperplane.fill": "send",
|
|
19
|
+
"chevron.left.forwardslash.chevron.right": "code",
|
|
20
|
+
"chevron.right": "chevron-right",
|
|
21
21
|
} as IconMapping;
|
|
22
22
|
|
|
23
23
|
/**
|
|
@@ -3,26 +3,26 @@
|
|
|
3
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
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { Platform } from
|
|
6
|
+
import { Platform } from "react-native";
|
|
7
7
|
|
|
8
|
-
const tintColorLight =
|
|
9
|
-
const tintColorDark =
|
|
8
|
+
const tintColorLight = "#0a7ea4";
|
|
9
|
+
const tintColorDark = "#fff";
|
|
10
10
|
|
|
11
11
|
export const Colors = {
|
|
12
12
|
light: {
|
|
13
|
-
text:
|
|
14
|
-
background:
|
|
13
|
+
text: "#11181C",
|
|
14
|
+
background: "#fff",
|
|
15
15
|
tint: tintColorLight,
|
|
16
|
-
icon:
|
|
17
|
-
tabIconDefault:
|
|
16
|
+
icon: "#687076",
|
|
17
|
+
tabIconDefault: "#687076",
|
|
18
18
|
tabIconSelected: tintColorLight,
|
|
19
19
|
},
|
|
20
20
|
dark: {
|
|
21
|
-
text:
|
|
22
|
-
background:
|
|
21
|
+
text: "#ECEDEE",
|
|
22
|
+
background: "#151718",
|
|
23
23
|
tint: tintColorDark,
|
|
24
|
-
icon:
|
|
25
|
-
tabIconDefault:
|
|
24
|
+
icon: "#9BA1A6",
|
|
25
|
+
tabIconDefault: "#9BA1A6",
|
|
26
26
|
tabIconSelected: tintColorDark,
|
|
27
27
|
},
|
|
28
28
|
};
|
|
@@ -30,19 +30,19 @@ export const Colors = {
|
|
|
30
30
|
export const Fonts = Platform.select({
|
|
31
31
|
ios: {
|
|
32
32
|
/** iOS `UIFontDescriptorSystemDesignDefault` */
|
|
33
|
-
sans:
|
|
33
|
+
sans: "system-ui",
|
|
34
34
|
/** iOS `UIFontDescriptorSystemDesignSerif` */
|
|
35
|
-
serif:
|
|
35
|
+
serif: "ui-serif",
|
|
36
36
|
/** iOS `UIFontDescriptorSystemDesignRounded` */
|
|
37
|
-
rounded:
|
|
37
|
+
rounded: "ui-rounded",
|
|
38
38
|
/** iOS `UIFontDescriptorSystemDesignMonospaced` */
|
|
39
|
-
mono:
|
|
39
|
+
mono: "ui-monospace",
|
|
40
40
|
},
|
|
41
41
|
default: {
|
|
42
|
-
sans:
|
|
43
|
-
serif:
|
|
44
|
-
rounded:
|
|
45
|
-
mono:
|
|
42
|
+
sans: "normal",
|
|
43
|
+
serif: "serif",
|
|
44
|
+
rounded: "normal",
|
|
45
|
+
mono: "monospace",
|
|
46
46
|
},
|
|
47
47
|
web: {
|
|
48
48
|
sans: "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useColorScheme } from
|
|
1
|
+
export { useColorScheme } from "react-native";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useEffect, useState } from
|
|
2
|
-
import { useColorScheme as useRNColorScheme } from
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { useColorScheme as useRNColorScheme } from "react-native";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* To support static rendering, this value needs to be re-calculated on the client side for web
|
|
@@ -17,5 +17,5 @@ export function useColorScheme() {
|
|
|
17
17
|
return colorScheme;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
return
|
|
20
|
+
return "light";
|
|
21
21
|
}
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
* https://docs.expo.dev/guides/color-schemes/
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { Colors } from
|
|
7
|
-
import { useColorScheme } from
|
|
6
|
+
import { Colors } from "@/constants/theme";
|
|
7
|
+
import { useColorScheme } from "@/hooks/use-color-scheme";
|
|
8
8
|
|
|
9
9
|
export function useThemeColor(
|
|
10
10
|
props: { light?: string; dark?: string },
|
|
11
|
-
colorName: keyof typeof Colors.light & keyof typeof Colors.dark
|
|
11
|
+
colorName: keyof typeof Colors.light & keyof typeof Colors.dark,
|
|
12
12
|
) {
|
|
13
|
-
const theme = useColorScheme() ??
|
|
13
|
+
const theme = useColorScheme() ?? "light";
|
|
14
14
|
const colorFromProps = props[theme];
|
|
15
15
|
|
|
16
16
|
if (colorFromProps) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobile",
|
|
3
|
-
"main": "expo-router/entry",
|
|
4
3
|
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"main": "expo-router/entry",
|
|
5
6
|
"scripts": {
|
|
6
7
|
"dev": "expo start",
|
|
7
8
|
"start": "expo start",
|
|
@@ -39,6 +40,5 @@
|
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
42
|
"eslint-config-expo": "~55.0.0"
|
|
42
|
-
}
|
|
43
|
-
"private": true
|
|
43
|
+
}
|
|
44
44
|
}
|
|
@@ -91,7 +91,7 @@ const moveDirectories = async (userInput) => {
|
|
|
91
91
|
userInput === "y"
|
|
92
92
|
? `\n3. Delete the /${exampleDir} directory when you're done referencing it.`
|
|
93
93
|
: ""
|
|
94
|
-
}
|
|
94
|
+
}`,
|
|
95
95
|
);
|
|
96
96
|
} catch (error) {
|
|
97
97
|
console.error(`❌ Error during script execution: ${error.message}`);
|
|
@@ -108,5 +108,5 @@ rl.question(
|
|
|
108
108
|
console.log("❌ Invalid input. Please enter 'Y' or 'N'.");
|
|
109
109
|
rl.close();
|
|
110
110
|
}
|
|
111
|
-
}
|
|
111
|
+
},
|
|
112
112
|
);
|