create-croissant 0.1.55 → 0.1.57

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.
Files changed (120) hide show
  1. package/dist/add.js +5 -5
  2. package/dist/index.js +1 -1
  3. package/package.json +1 -1
  4. package/template/README.md +10 -3
  5. package/template/apps/desktop/.vscode/extensions.json +1 -1
  6. package/template/apps/desktop/README.md +3 -30
  7. package/template/apps/desktop/index.html +14 -0
  8. package/template/apps/desktop/package.json +21 -32
  9. package/template/apps/desktop/public/tauri.svg +6 -0
  10. package/template/apps/desktop/public/vite.svg +1 -0
  11. package/template/apps/desktop/src/App.css +116 -0
  12. package/template/apps/desktop/src/App.tsx +51 -0
  13. package/template/apps/desktop/src/assets/react.svg +1 -0
  14. package/template/apps/desktop/src/{renderer/src/components → components}/app-sidebar.tsx +7 -3
  15. package/template/apps/desktop/src/components/login-form.tsx +160 -0
  16. package/template/apps/desktop/src/components/search-form.tsx +19 -0
  17. package/template/apps/desktop/src/components/signup-form.tsx +206 -0
  18. package/template/apps/desktop/src/components/version-switcher.tsx +54 -0
  19. package/template/apps/desktop/src/env.d.ts +1 -0
  20. package/template/apps/desktop/src/lib/auth-client.ts +5 -0
  21. package/template/apps/desktop/src/lib/orpc.ts +10 -0
  22. package/template/apps/desktop/src/main.tsx +12 -0
  23. package/template/apps/desktop/src/{renderer/src/routeTree.gen.ts → routeTree.gen.ts} +21 -0
  24. package/template/apps/desktop/src/router.tsx +19 -0
  25. package/template/apps/desktop/src/{renderer/src/routes → routes}/__root.tsx +9 -5
  26. package/template/apps/desktop/src/{renderer/src/routes → routes}/_auth/account.tsx +18 -10
  27. package/template/apps/desktop/src/routes/_auth/dashboard.tsx +58 -0
  28. package/template/apps/desktop/src/{renderer/src/routes → routes}/_auth/examples/client-orpc-auth.tsx +17 -6
  29. package/template/apps/desktop/src/{renderer/src/routes → routes}/_auth.tsx +2 -14
  30. package/template/apps/desktop/src/{renderer/src/routes → routes}/_public/examples/client-orpc.tsx +25 -5
  31. package/template/apps/desktop/src/{renderer/src/routes → routes}/_public/index.tsx +21 -9
  32. package/template/apps/desktop/src/routes/_public/login.tsx +34 -0
  33. package/template/apps/desktop/src/routes/_public/signup.tsx +31 -0
  34. package/template/apps/desktop/src/{renderer/src/routes → routes}/_public.tsx +1 -1
  35. package/template/apps/desktop/src/vite-env.d.ts +1 -0
  36. package/template/apps/desktop/src-tauri/Cargo.toml +25 -0
  37. package/template/apps/desktop/src-tauri/build.rs +3 -0
  38. package/template/apps/desktop/src-tauri/capabilities/default.json +7 -0
  39. package/template/apps/desktop/src-tauri/icons/128x128.png +0 -0
  40. package/template/apps/desktop/src-tauri/icons/128x128@2x.png +0 -0
  41. package/template/apps/desktop/src-tauri/icons/32x32.png +0 -0
  42. package/template/apps/desktop/src-tauri/icons/Square107x107Logo.png +0 -0
  43. package/template/apps/desktop/src-tauri/icons/Square142x142Logo.png +0 -0
  44. package/template/apps/desktop/src-tauri/icons/Square150x150Logo.png +0 -0
  45. package/template/apps/desktop/src-tauri/icons/Square284x284Logo.png +0 -0
  46. package/template/apps/desktop/src-tauri/icons/Square30x30Logo.png +0 -0
  47. package/template/apps/desktop/src-tauri/icons/Square310x310Logo.png +0 -0
  48. package/template/apps/desktop/src-tauri/icons/Square44x44Logo.png +0 -0
  49. package/template/apps/desktop/src-tauri/icons/Square71x71Logo.png +0 -0
  50. package/template/apps/desktop/src-tauri/icons/Square89x89Logo.png +0 -0
  51. package/template/apps/desktop/src-tauri/icons/StoreLogo.png +0 -0
  52. package/template/apps/desktop/src-tauri/icons/icon.icns +0 -0
  53. package/template/apps/desktop/src-tauri/icons/icon.ico +0 -0
  54. package/template/apps/desktop/src-tauri/icons/icon.png +0 -0
  55. package/template/apps/desktop/src-tauri/src/lib.rs +14 -0
  56. package/template/apps/desktop/src-tauri/src/main.rs +6 -0
  57. package/template/apps/desktop/src-tauri/tauri.conf.json +35 -0
  58. package/template/apps/desktop/tsconfig.json +15 -4
  59. package/template/apps/desktop/tsconfig.node.json +5 -3
  60. package/template/apps/desktop/vite.config.ts +40 -0
  61. package/template/apps/mobile/app/(tabs)/_layout.tsx +11 -10
  62. package/template/apps/mobile/app/(tabs)/explore.tsx +29 -27
  63. package/template/apps/mobile/app/(tabs)/index.tsx +25 -24
  64. package/template/apps/mobile/app/_layout.tsx +8 -8
  65. package/template/apps/mobile/app/modal.tsx +6 -6
  66. package/template/apps/mobile/components/external-link.tsx +5 -5
  67. package/template/apps/mobile/components/haptic-tab.tsx +4 -4
  68. package/template/apps/mobile/components/hello-wave.tsx +5 -4
  69. package/template/apps/mobile/components/parallax-scroll-view.tsx +15 -13
  70. package/template/apps/mobile/components/themed-text.tsx +14 -14
  71. package/template/apps/mobile/components/themed-view.tsx +3 -3
  72. package/template/apps/mobile/components/ui/collapsible.tsx +14 -13
  73. package/template/apps/mobile/components/ui/icon-symbol.ios.tsx +4 -4
  74. package/template/apps/mobile/components/ui/icon-symbol.tsx +9 -9
  75. package/template/apps/mobile/constants/theme.ts +19 -19
  76. package/template/apps/mobile/hooks/use-color-scheme.ts +1 -1
  77. package/template/apps/mobile/hooks/use-color-scheme.web.ts +3 -3
  78. package/template/apps/mobile/hooks/use-theme-color.ts +4 -4
  79. package/template/apps/mobile/package.json +7 -7
  80. package/template/apps/mobile/scripts/reset-project.js +2 -2
  81. package/template/apps/mobile/tsconfig.json +3 -13
  82. package/template/apps/platform/package.json +0 -1
  83. package/template/apps/platform/src/components/login-form.tsx +4 -1
  84. package/template/apps/platform/src/components/signup-form.tsx +15 -12
  85. package/template/apps/platform/src/routes/__root.tsx +7 -1
  86. package/template/apps/platform/src/routes/_public/examples/client-orpc.tsx +12 -3
  87. package/template/apps/platform/src/routes/_public/examples/ssr-orpc.tsx +2 -1
  88. package/template/package.json +7 -7
  89. package/template/packages/orpc/package.json +4 -4
  90. package/template/pnpm-workspace.yaml +5 -5
  91. package/template/apps/desktop/.editorconfig +0 -9
  92. package/template/apps/desktop/.eslintcache +0 -1
  93. package/template/apps/desktop/.vscode/launch.json +0 -39
  94. package/template/apps/desktop/.vscode/settings.json +0 -11
  95. package/template/apps/desktop/build/entitlements.mac.plist +0 -12
  96. package/template/apps/desktop/build/icon.icns +0 -0
  97. package/template/apps/desktop/build/icon.ico +0 -0
  98. package/template/apps/desktop/build/icon.png +0 -0
  99. package/template/apps/desktop/dev-app-update.yml +0 -3
  100. package/template/apps/desktop/electron-builder.yml +0 -45
  101. package/template/apps/desktop/electron.vite.config.ts +0 -26
  102. package/template/apps/desktop/resources/icon.png +0 -0
  103. package/template/apps/desktop/src/main/index.ts +0 -88
  104. package/template/apps/desktop/src/preload/index.d.ts +0 -11
  105. package/template/apps/desktop/src/preload/index.ts +0 -29
  106. package/template/apps/desktop/src/renderer/index.html +0 -17
  107. package/template/apps/desktop/src/renderer/src/assets/base.css +0 -67
  108. package/template/apps/desktop/src/renderer/src/assets/electron.svg +0 -10
  109. package/template/apps/desktop/src/renderer/src/assets/main.css +0 -171
  110. package/template/apps/desktop/src/renderer/src/assets/wavy-lines.svg +0 -25
  111. package/template/apps/desktop/src/renderer/src/components/Versions.tsx +0 -15
  112. package/template/apps/desktop/src/renderer/src/components/login-form.tsx +0 -57
  113. package/template/apps/desktop/src/renderer/src/env.d.ts +0 -6
  114. package/template/apps/desktop/src/renderer/src/lib/auth-client.ts +0 -5
  115. package/template/apps/desktop/src/renderer/src/lib/orpc.ts +0 -12
  116. package/template/apps/desktop/src/renderer/src/main.tsx +0 -22
  117. package/template/apps/desktop/src/renderer/src/routes/_auth/dashboard.tsx +0 -46
  118. package/template/apps/desktop/src/renderer/src/routes/_public/login.tsx +0 -16
  119. package/template/apps/desktop/tsconfig.web.json +0 -19
  120. package/template/apps/platform/src/lib/auth-client-electron.ts +0 -13
@@ -11,7 +11,12 @@ import { Field, FieldError, FieldLabel } from "@workspace/ui/components/field";
11
11
 
12
12
  import type { router } from "@workspace/orpc/router";
13
13
  import type { InferRouterOutputs } from "@orpc/server";
14
- import { usePlanets, useCreatePlanet, useUpdatePlanet, useDeletePlanet } from "@workspace/orpc/react";
14
+ import {
15
+ usePlanets,
16
+ useCreatePlanet,
17
+ useUpdatePlanet,
18
+ useDeletePlanet,
19
+ } from "@workspace/orpc/react";
15
20
 
16
21
  type Outputs = InferRouterOutputs<typeof router>;
17
22
  type Planet = Outputs["planets"]["getPlanets"][number];
@@ -28,6 +33,17 @@ const planetSchema = z.object({
28
33
  });
29
34
 
30
35
  export const Route = createFileRoute("/_public/examples/client-orpc")({
36
+ head: () => ({
37
+ meta: [
38
+ {
39
+ title: "Client + oRPC Example | Croissant Stack",
40
+ },
41
+ {
42
+ name: "description",
43
+ content: "Explore client-side data fetching and mutations with oRPC in Croissant Stack.",
44
+ },
45
+ ],
46
+ }),
31
47
  component: ClientORPC,
32
48
  });
33
49
 
@@ -124,7 +140,7 @@ function ClientORPC() {
124
140
  </p>
125
141
  </div>
126
142
 
127
- <div className="rounded-lg border p-6 bg-muted/30 dark:bg-zinc-900/30">
143
+ <div className="rounded-lg border p-6 bg-muted/30">
128
144
  <h2 className="font-semibold mb-4 flex items-center gap-2">
129
145
  {editingId ? <Pencil className="h-4 w-4" /> : <Plus className="h-4 w-4" />}
130
146
  {editingId ? "Edit Planet" : "Add New Planet"}
@@ -228,10 +244,14 @@ function ClientORPC() {
228
244
  <Button
229
245
  type="submit"
230
246
  className="flex items-center gap-2"
231
- disabled={!state.canSubmit || state.isSubmitting || updateMutation.isPending}
247
+ disabled={
248
+ !state.canSubmit || state.isSubmitting || updateMutation.isPending
249
+ }
232
250
  >
233
251
  <Check className="h-4 w-4" />{" "}
234
- {state.isSubmitting || updateMutation.isPending ? "Saving..." : "Save Changes"}
252
+ {state.isSubmitting || updateMutation.isPending
253
+ ? "Saving..."
254
+ : "Save Changes"}
235
255
  </Button>
236
256
  <Button
237
257
  variant="outline"
@@ -270,7 +290,7 @@ function ClientORPC() {
270
290
  {planets.map((planet) => (
271
291
  <div
272
292
  key={planet.id}
273
- className="flex items-center justify-between rounded-lg border p-4 bg-background shadow-sm hover:shadow-md transition-shadow dark:bg-zinc-900"
293
+ className="flex items-center justify-between rounded-lg border p-4 bg-background shadow-sm hover:shadow-md transition-shadow"
274
294
  >
275
295
  <div className="flex-1">
276
296
  <div className="flex items-center gap-2">
@@ -1,14 +1,28 @@
1
1
  import { Link, createFileRoute } from "@tanstack/react-router";
2
2
  import { Button } from "@workspace/ui/components/button";
3
- import { useHello, usePlanets } from "@workspace/orpc/react";
3
+ import type { AppRouter } from "@workspace/orpc/router";
4
+ import type { InferRouterOutputs } from "@orpc/server";
5
+ import { orpc } from "@/lib/orpc";
6
+
7
+ type Outputs = InferRouterOutputs<AppRouter>;
8
+ type Planet = Outputs["planets"]["getPlanets"][number];
4
9
 
5
10
  export const Route = createFileRoute("/_public/")({
11
+ loader: async () => {
12
+ const [helloRes, planets] = await Promise.all([
13
+ orpc.hello({ name: "Croissant Stack Desktop" }),
14
+ orpc.planets.getPlanets(),
15
+ ]);
16
+ return {
17
+ message: helloRes.message,
18
+ planets,
19
+ };
20
+ },
6
21
  component: App,
7
22
  });
8
23
 
9
24
  function App() {
10
- const { data: helloData, isLoading: helloLoading } = useHello("Croissant Desktop");
11
- const { data: planets, isLoading: planetsLoading } = usePlanets();
25
+ const { message, planets } = Route.useLoaderData();
12
26
 
13
27
  return (
14
28
  <div className="flex min-h-svh p-6">
@@ -16,20 +30,18 @@ function App() {
16
30
  <div>
17
31
  <h1 className="font-medium text-2xl mb-4">Desktop Project ready!</h1>
18
32
  <p>
19
- oRPC integration: <span className="font-bold">{helloLoading ? "Loading..." : helloData?.message}</span>
33
+ oRPC integration: <span className="font-bold">{message}</span>
20
34
  </p>
21
35
 
22
36
  <div className="mt-8">
23
37
  <h2 className="text-xl font-semibold mb-2">Planets from Database:</h2>
24
- {planetsLoading ? (
25
- <p className="text-gray-500 italic">Loading planets...</p>
26
- ) : !planets || planets.length === 0 ? (
38
+ {planets.length === 0 ? (
27
39
  <p className="text-gray-500 italic">
28
- No planets found in the database.
40
+ No planets found in the database. Run `db:push` and seed data if needed.
29
41
  </p>
30
42
  ) : (
31
43
  <ul className="grid grid-cols-1 gap-2">
32
- {planets.map((planet) => (
44
+ {planets.map((planet: Planet) => (
33
45
  <li key={planet.id} className="rounded-md border p-3 shadow-sm">
34
46
  <span className="font-bold">{planet.name}</span> - {planet.description}
35
47
  </li>
@@ -0,0 +1,34 @@
1
+ import { createFileRoute } from "@tanstack/react-router";
2
+ import { LoginForm } from "@/components/login-form";
3
+
4
+ export const Route = createFileRoute("/_public/login")({
5
+ head: () => ({
6
+ meta: [
7
+ {
8
+ title: "Sign In | Croissant Stack",
9
+ },
10
+ {
11
+ name: "description",
12
+ content: "Sign in to your Croissant Stack account.",
13
+ },
14
+ {
15
+ name: "robots",
16
+ content: "noindex, follow",
17
+ },
18
+ ],
19
+ }),
20
+ headers: () => ({
21
+ "Cache-Control": "public, max-age=3600, s-maxage=3600, stale-while-revalidate=86400",
22
+ }),
23
+ component: Login,
24
+ });
25
+
26
+ function Login() {
27
+ return (
28
+ <div className="flex min-h-svh items-center justify-center p-6">
29
+ <div className="w-full max-w-sm">
30
+ <LoginForm />
31
+ </div>
32
+ </div>
33
+ );
34
+ }
@@ -0,0 +1,31 @@
1
+ import { createFileRoute } from "@tanstack/react-router";
2
+ import { SignupForm } from "@/components/signup-form";
3
+
4
+ export const Route = createFileRoute("/_public/signup")({
5
+ head: () => ({
6
+ meta: [
7
+ {
8
+ title: "Create an Account | Croissant Stack",
9
+ },
10
+ {
11
+ name: "description",
12
+ content:
13
+ "Join Croissant Stack today. Create an account to start building with the best stack.",
14
+ },
15
+ ],
16
+ }),
17
+ headers: () => ({
18
+ "Cache-Control": "public, max-age=3600, s-maxage=3600, stale-while-revalidate=86400",
19
+ }),
20
+ component: Signup,
21
+ });
22
+
23
+ function Signup() {
24
+ return (
25
+ <div className="flex min-h-svh items-center justify-center p-6">
26
+ <div className="w-full max-w-sm">
27
+ <SignupForm />
28
+ </div>
29
+ </div>
30
+ );
31
+ }
@@ -1,6 +1,6 @@
1
1
  import { Outlet, createFileRoute } from "@tanstack/react-router";
2
2
  import { SidebarProvider, SidebarTrigger } from "@workspace/ui/components/sidebar";
3
- import { PublicSidebar } from "@renderer/components/app-sidebar";
3
+ import { PublicSidebar } from "@/components/app-sidebar";
4
4
 
5
5
  export const Route = createFileRoute("/_public")({
6
6
  component: PublicLayout,
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -0,0 +1,25 @@
1
+ [package]
2
+ name = "desktop"
3
+ version = "0.1.0"
4
+ description = "A Tauri App"
5
+ authors = ["you"]
6
+ edition = "2021"
7
+
8
+ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
9
+
10
+ [lib]
11
+ # The `_lib` suffix may seem redundant but it is necessary
12
+ # to make the lib name unique and wouldn't conflict with the bin name.
13
+ # This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
14
+ name = "desktop_lib"
15
+ crate-type = ["staticlib", "cdylib", "rlib"]
16
+
17
+ [build-dependencies]
18
+ tauri-build = { version = "2", features = [] }
19
+
20
+ [dependencies]
21
+ tauri = { version = "2", features = [] }
22
+ tauri-plugin-opener = "2"
23
+ serde = { version = "1", features = ["derive"] }
24
+ serde_json = "1"
25
+
@@ -0,0 +1,3 @@
1
+ fn main() {
2
+ tauri_build::build()
3
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "../gen/schemas/desktop-schema.json",
3
+ "identifier": "default",
4
+ "description": "Capability for the main window",
5
+ "windows": ["main"],
6
+ "permissions": ["core:default", "opener:default"]
7
+ }
@@ -0,0 +1,14 @@
1
+ // Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
2
+ #[tauri::command]
3
+ fn greet(name: &str) -> String {
4
+ format!("Hello, {}! You've been greeted from Rust!", name)
5
+ }
6
+
7
+ #[cfg_attr(mobile, tauri::mobile_entry_point)]
8
+ pub fn run() {
9
+ tauri::Builder::default()
10
+ .plugin(tauri_plugin_opener::init())
11
+ .invoke_handler(tauri::generate_handler![greet])
12
+ .run(tauri::generate_context!())
13
+ .expect("error while running tauri application");
14
+ }
@@ -0,0 +1,6 @@
1
+ // Prevents additional console window on Windows in release, DO NOT REMOVE!!
2
+ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
3
+
4
+ fn main() {
5
+ desktop_lib::run()
6
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "$schema": "https://schema.tauri.app/config/2",
3
+ "productName": "desktop",
4
+ "version": "0.1.0",
5
+ "identifier": "com.croissantlabs.desktop",
6
+ "build": {
7
+ "beforeDevCommand": "pnpm dev",
8
+ "devUrl": "http://localhost:1420",
9
+ "beforeBuildCommand": "pnpm build",
10
+ "frontendDist": "../dist"
11
+ },
12
+ "app": {
13
+ "windows": [
14
+ {
15
+ "title": "desktop",
16
+ "width": 800,
17
+ "height": 600
18
+ }
19
+ ],
20
+ "security": {
21
+ "csp": null
22
+ }
23
+ },
24
+ "bundle": {
25
+ "active": true,
26
+ "targets": "all",
27
+ "icon": [
28
+ "icons/32x32.png",
29
+ "icons/128x128.png",
30
+ "icons/128x128@2x.png",
31
+ "icons/icon.icns",
32
+ "icons/icon.ico"
33
+ ]
34
+ }
35
+ }
@@ -1,6 +1,17 @@
1
1
  {
2
- "files": [],
3
- "references": [{ "path": "./tsconfig.node.json" }, { "path": "./tsconfig.web.json" }],
4
- "include": [],
5
- "exclude": ["node_modules", "out", "dist"]
2
+ "extends": "@workspace/config-typescript/react.json",
3
+ "include": ["**/*.ts", "**/*.tsx", "vite.config.ts"],
4
+ "compilerOptions": {
5
+ "target": "ES2022",
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "module": "ESNext",
8
+ "moduleResolution": "bundler",
9
+ "allowImportingTsExtensions": true,
10
+ "verbatimModuleSyntax": true,
11
+ "jsx": "react-jsx",
12
+ "paths": {
13
+ "@/*": ["./src/*"],
14
+ "@workspace/ui/*": ["../../packages/ui/src/*"]
15
+ }
16
+ }
6
17
  }
@@ -1,8 +1,10 @@
1
1
  {
2
- "extends": "@workspace/config-typescript/base.json",
3
2
  "compilerOptions": {
4
3
  "composite": true,
5
- "types": ["electron-vite/node"]
4
+ "skipLibCheck": true,
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "allowSyntheticDefaultImports": true
6
8
  },
7
- "include": ["src/main/**/*", "src/preload/**/*", "electron.vite.config.ts"]
9
+ "include": ["vite.config.ts"]
8
10
  }
@@ -0,0 +1,40 @@
1
+ import { defineConfig } from "vite";
2
+ import react from "@vitejs/plugin-react";
3
+ import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
4
+ import tailwindcss from "@tailwindcss/vite";
5
+ import tsconfigPaths from "vite-tsconfig-paths";
6
+
7
+ // https://vite.dev/config/
8
+ export default defineConfig(async () => ({
9
+ plugins: [
10
+ tsconfigPaths(),
11
+ TanStackRouterVite({
12
+ routesDirectory: "./src/routes",
13
+ generatedRouteTree: "./src/routeTree.gen.ts",
14
+ }),
15
+ react(),
16
+ tailwindcss(),
17
+ ],
18
+
19
+ // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
20
+ //
21
+ // 1. prevent Vite from obscuring rust errors
22
+ clearScreen: false,
23
+ // 2. tauri expects a fixed port, fail if that port is not available
24
+ server: {
25
+ port: 1420,
26
+ strictPort: true,
27
+ host: process.env.TAURI_DEV_HOST || false,
28
+ hmr: process.env.TAURI_DEV_HOST
29
+ ? {
30
+ protocol: "ws",
31
+ host: process.env.TAURI_DEV_HOST,
32
+ port: 1421,
33
+ }
34
+ : undefined,
35
+ watch: {
36
+ // 3. tell Vite to ignore watching `src-tauri`
37
+ ignored: ["**/src-tauri/**"],
38
+ },
39
+ },
40
+ }));
@@ -1,10 +1,10 @@
1
- import { Tabs } from 'expo-router';
2
- import React from 'react';
1
+ import { Tabs } from "expo-router";
2
+ import React from "react";
3
3
 
4
- import { HapticTab } from '@/components/haptic-tab';
5
- import { IconSymbol } from '@/components/ui/icon-symbol';
6
- import { Colors } from '@/constants/theme';
7
- import { useColorScheme } from '@/hooks/use-color-scheme';
4
+ import { HapticTab } from "@/components/haptic-tab";
5
+ import { IconSymbol } from "@/components/ui/icon-symbol";
6
+ import { Colors } from "@/constants/theme";
7
+ import { useColorScheme } from "@/hooks/use-color-scheme";
8
8
 
9
9
  export default function TabLayout() {
10
10
  const colorScheme = useColorScheme();
@@ -12,21 +12,22 @@ export default function TabLayout() {
12
12
  return (
13
13
  <Tabs
14
14
  screenOptions={{
15
- tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
15
+ tabBarActiveTintColor: Colors[colorScheme ?? "light"].tint,
16
16
  headerShown: false,
17
17
  tabBarButton: HapticTab,
18
- }}>
18
+ }}
19
+ >
19
20
  <Tabs.Screen
20
21
  name="index"
21
22
  options={{
22
- title: 'Home',
23
+ title: "Home",
23
24
  tabBarIcon: ({ color }) => <IconSymbol size={28} name="house.fill" color={color} />,
24
25
  }}
25
26
  />
26
27
  <Tabs.Screen
27
28
  name="explore"
28
29
  options={{
29
- title: 'Explore',
30
+ title: "Explore",
30
31
  tabBarIcon: ({ color }) => <IconSymbol size={28} name="paperplane.fill" color={color} />,
31
32
  }}
32
33
  />
@@ -1,18 +1,18 @@
1
- import { Image } from 'expo-image';
2
- import { Platform, StyleSheet } from 'react-native';
1
+ import { Image } from "expo-image";
2
+ import { Platform, StyleSheet } from "react-native";
3
3
 
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';
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: '#D0D0D0', dark: '#353636' }}
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('@/assets/images/react-logo.png')}
62
- style={{ width: 100, height: 100, alignSelf: 'center' }}
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&apos;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: '#808080',
105
+ color: "#808080",
104
106
  bottom: -90,
105
107
  left: -35,
106
- position: 'absolute',
108
+ position: "absolute",
107
109
  },
108
110
  titleContainer: {
109
- flexDirection: 'row',
111
+ flexDirection: "row",
110
112
  gap: 8,
111
113
  },
112
114
  });