create-croissant 0.1.39 → 0.1.41
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/dist/index.js +5 -5
- package/package.json +7 -10
- package/template/.oxlintignore +11 -0
- package/template/README.md +6 -6
- package/template/apps/desktop/README.md +1 -1
- 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 +4 -13
- 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 +1 -1
- package/template/apps/desktop/tsconfig.web.json +4 -11
- 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 -6
- 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 +2 -6
- 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/routeTree.gen.ts +264 -267
- 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 +17 -17
- 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/tsconfig.json +1 -1
- package/template/apps/platform/vite.config.ts +8 -8
- package/template/docker-compose.yml +1 -1
- package/template/package.json +24 -22
- package/template/packages/auth/package.json +8 -12
- package/template/packages/auth/src/lib/auth.ts +1 -1
- package/template/packages/auth/tsconfig.json +1 -1
- package/template/packages/db/package.json +6 -10
- package/template/packages/db/src/index.ts +4 -4
- package/template/packages/db/src/schema.ts +2 -2
- package/template/packages/db/tsconfig.json +1 -1
- package/template/packages/orpc/package.json +6 -10
- package/template/packages/orpc/src/lib/planets.ts +39 -43
- package/template/packages/orpc/src/lib/router.ts +15 -15
- package/template/packages/orpc/tsconfig.json +1 -1
- package/template/packages/ui/package.json +8 -12
- 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/packages/ui/tsconfig.json +1 -1
- 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,18 +1,18 @@
|
|
|
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 { Collapsible } from
|
|
5
|
-
import { ExternalLink } from
|
|
6
|
-
import ParallaxScrollView from
|
|
7
|
-
import { ThemedText } from
|
|
8
|
-
import { ThemedView } from
|
|
9
|
-
import { IconSymbol } from
|
|
10
|
-
import { Fonts } from
|
|
4
|
+
import { Collapsible } from "@/components/ui/collapsible";
|
|
5
|
+
import { ExternalLink } from "@/components/external-link";
|
|
6
|
+
import ParallaxScrollView from "@/components/parallax-scroll-view";
|
|
7
|
+
import { ThemedText } from "@/components/themed-text";
|
|
8
|
+
import { ThemedView } from "@/components/themed-view";
|
|
9
|
+
import { IconSymbol } from "@/components/ui/icon-symbol";
|
|
10
|
+
import { Fonts } from "@/constants/theme";
|
|
11
11
|
|
|
12
12
|
export default function TabTwoScreen() {
|
|
13
13
|
return (
|
|
14
14
|
<ParallaxScrollView
|
|
15
|
-
headerBackgroundColor={{ light:
|
|
15
|
+
headerBackgroundColor={{ light: "#D0D0D0", dark: "#353636" }}
|
|
16
16
|
headerImage={
|
|
17
17
|
<IconSymbol
|
|
18
18
|
size={310}
|
|
@@ -20,25 +20,27 @@ export default function TabTwoScreen() {
|
|
|
20
20
|
name="chevron.left.forwardslash.chevron.right"
|
|
21
21
|
style={styles.headerImage}
|
|
22
22
|
/>
|
|
23
|
-
}
|
|
23
|
+
}
|
|
24
|
+
>
|
|
24
25
|
<ThemedView style={styles.titleContainer}>
|
|
25
26
|
<ThemedText
|
|
26
27
|
type="title"
|
|
27
28
|
style={{
|
|
28
29
|
fontFamily: Fonts.rounded,
|
|
29
|
-
}}
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
30
32
|
Explore
|
|
31
33
|
</ThemedText>
|
|
32
34
|
</ThemedView>
|
|
33
35
|
<ThemedText>This app includes example code to help you get started.</ThemedText>
|
|
34
36
|
<Collapsible title="File-based routing">
|
|
35
37
|
<ThemedText>
|
|
36
|
-
This app has two screens:{
|
|
37
|
-
<ThemedText type="defaultSemiBold">app/(tabs)/index.tsx</ThemedText> and{
|
|
38
|
+
This app has two screens:{" "}
|
|
39
|
+
<ThemedText type="defaultSemiBold">app/(tabs)/index.tsx</ThemedText> and{" "}
|
|
38
40
|
<ThemedText type="defaultSemiBold">app/(tabs)/explore.tsx</ThemedText>
|
|
39
41
|
</ThemedText>
|
|
40
42
|
<ThemedText>
|
|
41
|
-
The layout file in <ThemedText type="defaultSemiBold">app/(tabs)/_layout.tsx</ThemedText>{
|
|
43
|
+
The layout file in <ThemedText type="defaultSemiBold">app/(tabs)/_layout.tsx</ThemedText>{" "}
|
|
42
44
|
sets up the tab navigator.
|
|
43
45
|
</ThemedText>
|
|
44
46
|
<ExternalLink href="https://docs.expo.dev/router/introduction">
|
|
@@ -47,19 +49,19 @@ export default function TabTwoScreen() {
|
|
|
47
49
|
</Collapsible>
|
|
48
50
|
<Collapsible title="Android, iOS, and web support">
|
|
49
51
|
<ThemedText>
|
|
50
|
-
You can open this project on Android, iOS, and the web. To open the web version, press{
|
|
52
|
+
You can open this project on Android, iOS, and the web. To open the web version, press{" "}
|
|
51
53
|
<ThemedText type="defaultSemiBold">w</ThemedText> in the terminal running this project.
|
|
52
54
|
</ThemedText>
|
|
53
55
|
</Collapsible>
|
|
54
56
|
<Collapsible title="Images">
|
|
55
57
|
<ThemedText>
|
|
56
|
-
For static images, you can use the <ThemedText type="defaultSemiBold">@2x</ThemedText> and{
|
|
58
|
+
For static images, you can use the <ThemedText type="defaultSemiBold">@2x</ThemedText> and{" "}
|
|
57
59
|
<ThemedText type="defaultSemiBold">@3x</ThemedText> suffixes to provide files for
|
|
58
60
|
different screen densities
|
|
59
61
|
</ThemedText>
|
|
60
62
|
<Image
|
|
61
|
-
source={require(
|
|
62
|
-
style={{ width: 100, height: 100, alignSelf:
|
|
63
|
+
source={require("@/assets/images/react-logo.png")}
|
|
64
|
+
style={{ width: 100, height: 100, alignSelf: "center" }}
|
|
63
65
|
/>
|
|
64
66
|
<ExternalLink href="https://reactnative.dev/docs/images">
|
|
65
67
|
<ThemedText type="link">Learn more</ThemedText>
|
|
@@ -67,7 +69,7 @@ export default function TabTwoScreen() {
|
|
|
67
69
|
</Collapsible>
|
|
68
70
|
<Collapsible title="Light and dark mode components">
|
|
69
71
|
<ThemedText>
|
|
70
|
-
This template has light and dark mode support. The{
|
|
72
|
+
This template has light and dark mode support. The{" "}
|
|
71
73
|
<ThemedText type="defaultSemiBold">useColorScheme()</ThemedText> hook lets you inspect
|
|
72
74
|
what the user's current color scheme is, and so you can adjust UI colors accordingly.
|
|
73
75
|
</ThemedText>
|
|
@@ -77,18 +79,18 @@ export default function TabTwoScreen() {
|
|
|
77
79
|
</Collapsible>
|
|
78
80
|
<Collapsible title="Animations">
|
|
79
81
|
<ThemedText>
|
|
80
|
-
This template includes an example of an animated component. The{
|
|
82
|
+
This template includes an example of an animated component. The{" "}
|
|
81
83
|
<ThemedText type="defaultSemiBold">components/HelloWave.tsx</ThemedText> component uses
|
|
82
|
-
the powerful{
|
|
84
|
+
the powerful{" "}
|
|
83
85
|
<ThemedText type="defaultSemiBold" style={{ fontFamily: Fonts.mono }}>
|
|
84
86
|
react-native-reanimated
|
|
85
|
-
</ThemedText>{
|
|
87
|
+
</ThemedText>{" "}
|
|
86
88
|
library to create a waving hand animation.
|
|
87
89
|
</ThemedText>
|
|
88
90
|
{Platform.select({
|
|
89
91
|
ios: (
|
|
90
92
|
<ThemedText>
|
|
91
|
-
The <ThemedText type="defaultSemiBold">components/ParallaxScrollView.tsx</ThemedText>{
|
|
93
|
+
The <ThemedText type="defaultSemiBold">components/ParallaxScrollView.tsx</ThemedText>{" "}
|
|
92
94
|
component provides a parallax effect for the header image.
|
|
93
95
|
</ThemedText>
|
|
94
96
|
),
|
|
@@ -100,13 +102,13 @@ export default function TabTwoScreen() {
|
|
|
100
102
|
|
|
101
103
|
const styles = StyleSheet.create({
|
|
102
104
|
headerImage: {
|
|
103
|
-
color:
|
|
105
|
+
color: "#808080",
|
|
104
106
|
bottom: -90,
|
|
105
107
|
left: -35,
|
|
106
|
-
position:
|
|
108
|
+
position: "absolute",
|
|
107
109
|
},
|
|
108
110
|
titleContainer: {
|
|
109
|
-
flexDirection:
|
|
111
|
+
flexDirection: "row",
|
|
110
112
|
gap: 8,
|
|
111
113
|
},
|
|
112
114
|
});
|
|
@@ -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
|
/**
|