create-fate 1.3.3 → 1.5.0
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/bin/create-fate.mjs +41 -3
- package/package.json +1 -1
- package/templates/fate/_shared/vue-app/package.json +14 -16
- package/templates/fate/cloudflare/README.md +11 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/browserslist +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/cf-wrangler +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/drizzle-kit +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/esbuild +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/fate +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/fbtee +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/intent +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/jiti +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/oxlint +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/rolldown +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/tsc +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/tsx +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/vitest +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/void +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/vp +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/vpr +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/workerd +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/wrangler +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/wrangler2 +22 -0
- package/templates/fate/cloudflare/client/package.json +26 -21
- package/templates/fate/cloudflare/client/pages/layout.tsx +2 -16
- package/templates/fate/cloudflare/client/src/lib/AvailableLanguages.tsx +3 -3
- package/templates/fate/cloudflare/client/src/lib/LocaleContext.tsx +61 -0
- package/templates/fate/cloudflare/client/src/ui/LocaleSwitcher.tsx +26 -44
- package/templates/fate/cloudflare/client/start.mjs +11 -0
- package/templates/fate/cloudflare/client/translations/{de_DE.json → de-DE.json} +56 -113
- package/templates/fate/{graphql/client/translations/ja_JP.json → cloudflare/client/translations/ja-JP.json} +56 -113
- package/templates/fate/cloudflare/client/vite.config.ts +4 -8
- package/templates/fate/cloudflare/package.json +6 -10
- package/templates/fate/cloudflare/pnpm-workspace.yaml +4 -4
- package/templates/fate/cloudflare/server/db/migrations/20260508073357_initial_schema.sql +3 -2
- package/templates/fate/cloudflare/server/db/migrations/20260508120500_seed_cloudflare_demo.sql +10 -10
- package/templates/fate/cloudflare/server/db/migrations/meta/20260508073357_snapshot.json +10 -3
- package/templates/fate/cloudflare/server/db/schema.ts +2 -3
- package/templates/fate/cloudflare/server/node_modules/.bin/cf-wrangler +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/drizzle-kit +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/esbuild +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/fate +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/intent +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/jiti +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/oxlint +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/tsc +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/tsx +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/vitest +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/vp +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/vpr +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/workerd +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/wrangler +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/wrangler2 +22 -0
- package/templates/fate/cloudflare/server/package.json +3 -3
- package/templates/fate/cloudflare/server/src/fate/server.ts +5 -2
- package/templates/fate/cloudflare/server/src/lib/auth.ts +0 -2
- package/templates/fate/cloudflare/server/tsconfig.json +1 -1
- package/templates/fate/cloudflare/tsconfig.json +2 -11
- package/templates/fate/cloudflare/vite.config.ts +3 -0
- package/templates/fate/drizzle/README.md +11 -0
- package/templates/fate/drizzle/client/node_modules/.bin/browserslist +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/cf-wrangler +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/drizzle-kit +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/esbuild +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/fate +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/fbtee +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/intent +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/jiti +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/oxlint +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/rolldown +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/tsc +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/tsx +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/vitest +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/void +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/vp +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/vpr +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/workerd +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/wrangler +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/wrangler2 +22 -0
- package/templates/fate/drizzle/client/package.json +28 -24
- package/templates/fate/drizzle/client/pages/layout.tsx +2 -16
- package/templates/fate/drizzle/client/src/lib/AvailableLanguages.tsx +3 -3
- package/templates/fate/drizzle/client/src/lib/LocaleContext.tsx +61 -0
- package/templates/fate/drizzle/client/src/ui/LocaleSwitcher.tsx +26 -44
- package/templates/fate/drizzle/client/start.mjs +11 -0
- package/templates/fate/{graphql/client/translations/de_DE.json → drizzle/client/translations/de-DE.json} +56 -113
- package/templates/fate/{cloudflare/client/translations/ja_JP.json → drizzle/client/translations/ja-JP.json} +56 -113
- package/templates/fate/drizzle/client/vite.config.ts +4 -8
- package/templates/fate/drizzle/package.json +6 -10
- package/templates/fate/drizzle/pnpm-workspace.yaml +4 -4
- package/templates/fate/drizzle/server/node_modules/.bin/drizzle-kit +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/esbuild +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/fate +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/intent +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/jiti +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/nodemon +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/oxlint +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/tsc +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/tsx +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/vitest +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/vp +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/vpr +22 -0
- package/templates/fate/drizzle/server/package.json +9 -9
- package/templates/fate/drizzle/server/src/app.tsx +1 -1
- package/templates/fate/drizzle/server/src/drizzle/schema.ts +2 -3
- package/templates/fate/drizzle/server/src/drizzle/seed.tsx +1 -1
- package/templates/fate/drizzle/tsconfig.json +1 -10
- package/templates/fate/graphql/README.md +11 -0
- package/templates/fate/graphql/client/node_modules/.bin/browserslist +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/cf-wrangler +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/drizzle-kit +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/esbuild +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/fate +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/fbtee +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/intent +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/jiti +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/oxlint +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/rolldown +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/tsc +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/tsx +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/vitest +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/void +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/vp +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/vpr +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/workerd +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/wrangler +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/wrangler2 +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/yaml +22 -0
- package/templates/fate/graphql/client/package.json +27 -23
- package/templates/fate/graphql/client/pages/layout.tsx +2 -16
- package/templates/fate/graphql/client/src/lib/AvailableLanguages.tsx +3 -3
- package/templates/fate/graphql/client/src/lib/LocaleContext.tsx +61 -0
- package/templates/fate/graphql/client/src/ui/LocaleSwitcher.tsx +26 -44
- package/templates/fate/graphql/client/src/ui/PostCard.tsx +1 -1
- package/templates/fate/graphql/client/start.mjs +11 -0
- package/templates/fate/{drizzle/client/translations/de_DE.json → graphql/client/translations/de-DE.json} +56 -113
- package/templates/fate/{http/client/translations/ja_JP.json → graphql/client/translations/ja-JP.json} +56 -113
- package/templates/fate/graphql/client/vite.config.ts +4 -8
- package/templates/fate/graphql/package.json +7 -11
- package/templates/fate/graphql/pnpm-workspace.yaml +4 -4
- package/templates/fate/graphql/server/package.json +25 -29
- package/templates/fate/graphql/server/prisma.config.ts +9 -1
- package/templates/fate/graphql/server/scripts/generate-graphql.tsx +1 -1
- package/templates/fate/graphql/server/src/index.tsx +1 -1
- package/templates/fate/graphql/server/src/prisma/schema.prisma +2 -1
- package/templates/fate/graphql/server/src/prisma/seed.tsx +1 -1
- package/templates/fate/graphql/server/tsconfig.json +1 -11
- package/templates/fate/graphql/tsconfig.json +1 -10
- package/templates/fate/graphql-client/README.md +9 -0
- package/templates/fate/graphql-client/_gitignore +3 -0
- package/templates/fate/graphql-client/package.json +27 -24
- package/templates/fate/graphql-client/pages/index.tsx +61 -27
- package/templates/fate/graphql-client/pages/layout.tsx +22 -15
- package/templates/fate/graphql-client/pnpm-workspace.yaml +6 -4
- package/templates/fate/graphql-client/src/lib/AvailableLanguages.tsx +5 -0
- package/templates/fate/graphql-client/src/lib/LocaleContext.tsx +61 -0
- package/templates/fate/graphql-client/src/ui/LocaleSwitcher.tsx +34 -0
- package/templates/fate/graphql-client/translations/de-DE.json +225 -0
- package/templates/fate/graphql-client/translations/ja-JP.json +225 -0
- package/templates/fate/graphql-client/vite.config.ts +9 -13
- package/templates/fate/http/README.md +11 -0
- package/templates/fate/http/client/node_modules/.bin/browserslist +22 -0
- package/templates/fate/http/client/node_modules/.bin/cf-wrangler +22 -0
- package/templates/fate/http/client/node_modules/.bin/drizzle-kit +22 -0
- package/templates/fate/http/client/node_modules/.bin/esbuild +22 -0
- package/templates/fate/http/client/node_modules/.bin/fate +22 -0
- package/templates/fate/http/client/node_modules/.bin/fbtee +22 -0
- package/templates/fate/http/client/node_modules/.bin/intent +22 -0
- package/templates/fate/http/client/node_modules/.bin/jiti +22 -0
- package/templates/fate/http/client/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/http/client/node_modules/.bin/oxlint +22 -0
- package/templates/fate/http/client/node_modules/.bin/rolldown +22 -0
- package/templates/fate/http/client/node_modules/.bin/tsc +22 -0
- package/templates/fate/http/client/node_modules/.bin/tsx +22 -0
- package/templates/fate/http/client/node_modules/.bin/vitest +22 -0
- package/templates/fate/http/client/node_modules/.bin/void +22 -0
- package/templates/fate/http/client/node_modules/.bin/vp +22 -0
- package/templates/fate/http/client/node_modules/.bin/vpr +22 -0
- package/templates/fate/http/client/node_modules/.bin/workerd +22 -0
- package/templates/fate/http/client/node_modules/.bin/wrangler +22 -0
- package/templates/fate/http/client/node_modules/.bin/wrangler2 +22 -0
- package/templates/fate/http/client/package.json +26 -22
- package/templates/fate/http/client/pages/layout.tsx +2 -16
- package/templates/fate/http/client/src/lib/AvailableLanguages.tsx +3 -3
- package/templates/fate/http/client/src/lib/LocaleContext.tsx +61 -0
- package/templates/fate/http/client/src/ui/LocaleSwitcher.tsx +26 -44
- package/templates/fate/http/client/start.mjs +11 -0
- package/templates/fate/http/client/translations/{de_DE.json → de-DE.json} +56 -113
- package/templates/fate/{drizzle/client/translations/ja_JP.json → http/client/translations/ja-JP.json} +56 -113
- package/templates/fate/http/client/vite.config.ts +4 -8
- package/templates/fate/http/package.json +6 -10
- package/templates/fate/http/pnpm-workspace.yaml +4 -4
- package/templates/fate/http/server/node_modules/.bin/drizzle-kit +22 -0
- package/templates/fate/http/server/node_modules/.bin/esbuild +22 -0
- package/templates/fate/http/server/node_modules/.bin/fate +22 -0
- package/templates/fate/http/server/node_modules/.bin/intent +22 -0
- package/templates/fate/http/server/node_modules/.bin/jiti +22 -0
- package/templates/fate/http/server/node_modules/.bin/nodemon +22 -0
- package/templates/fate/http/server/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/http/server/node_modules/.bin/oxlint +22 -0
- package/templates/fate/http/server/node_modules/.bin/tsc +22 -0
- package/templates/fate/http/server/node_modules/.bin/tsx +22 -0
- package/templates/fate/http/server/node_modules/.bin/vitest +22 -0
- package/templates/fate/http/server/node_modules/.bin/vp +22 -0
- package/templates/fate/http/server/node_modules/.bin/vpr +22 -0
- package/templates/fate/http/server/package.json +8 -8
- package/templates/fate/http/server/src/app.tsx +1 -1
- package/templates/fate/http/server/src/drizzle/schema.ts +2 -3
- package/templates/fate/http/server/src/drizzle/seed.tsx +1 -1
- package/templates/fate/http/tsconfig.json +1 -10
- package/templates/fate/prisma/README.md +11 -0
- package/templates/fate/prisma/client/node_modules/.bin/browserslist +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/cf-wrangler +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/drizzle-kit +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/esbuild +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/fate +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/fbtee +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/intent +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/jiti +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/oxlint +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/rolldown +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/tsc +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/tsx +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/vitest +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/void +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/vp +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/vpr +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/workerd +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/wrangler +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/wrangler2 +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/yaml +22 -0
- package/templates/fate/prisma/client/package.json +28 -24
- package/templates/fate/prisma/client/pages/layout.tsx +2 -16
- package/templates/fate/prisma/client/src/lib/AvailableLanguages.tsx +3 -3
- package/templates/fate/prisma/client/src/lib/LocaleContext.tsx +61 -0
- package/templates/fate/prisma/client/src/ui/LocaleSwitcher.tsx +26 -44
- package/templates/fate/prisma/client/start.mjs +11 -0
- package/templates/fate/prisma/client/translations/de-DE.json +632 -0
- package/templates/fate/prisma/client/translations/ja-JP.json +632 -0
- package/templates/fate/prisma/client/vite.config.ts +4 -8
- package/templates/fate/prisma/package.json +7 -11
- package/templates/fate/prisma/pnpm-workspace.yaml +4 -4
- package/templates/fate/prisma/server/node_modules/.bin/esbuild +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/fate +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/intent +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/jiti +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/nft +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/nodemon +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/oxlint +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/prisma +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/tsc +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/tsx +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/vitest +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/vp +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/vpr +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/yaml +22 -0
- package/templates/fate/prisma/server/package.json +9 -9
- package/templates/fate/prisma/server/prisma.config.ts +2 -1
- package/templates/fate/prisma/server/src/app.tsx +1 -1
- package/templates/fate/prisma/server/src/prisma/schema.prisma +2 -1
- package/templates/fate/prisma/server/src/prisma/seed.tsx +1 -1
- package/templates/fate/prisma/tsconfig.json +1 -10
- package/templates/fate/void/README.md +9 -0
- package/templates/fate/void/_gitignore +3 -0
- package/templates/fate/void/db/migrations/20260508073357_initial_schema.sql +3 -2
- package/templates/fate/void/db/migrations/20260508120500_seed_void_demo.sql +10 -10
- package/templates/fate/void/db/migrations/meta/20260508073357_snapshot.json +10 -3
- package/templates/fate/void/db/schema.ts +2 -3
- package/templates/fate/void/middleware/01.shared.ts +3 -0
- package/templates/fate/void/package.json +30 -25
- package/templates/fate/void/pages/index.tsx +23 -10
- package/templates/fate/void/pages/layout.tsx +22 -19
- package/templates/fate/void/pages/login.tsx +22 -18
- package/templates/fate/void/pages/search.tsx +18 -4
- package/templates/fate/void/pnpm-workspace.yaml +4 -4
- package/templates/fate/void/src/fate/server.ts +2 -1
- package/templates/fate/void/src/lib/AvailableLanguages.tsx +5 -0
- package/templates/fate/void/src/lib/LocaleContext.tsx +61 -0
- package/templates/fate/void/src/ui/CategoryCard.tsx +22 -4
- package/templates/fate/void/src/ui/CreatePost.tsx +12 -7
- package/templates/fate/void/src/ui/Error.tsx +4 -2
- package/templates/fate/void/src/ui/EventCard.tsx +18 -5
- package/templates/fate/void/src/ui/Header.tsx +10 -4
- package/templates/fate/void/src/ui/LocaleSwitcher.tsx +34 -0
- package/templates/fate/void/src/ui/PostCard.tsx +29 -14
- package/templates/fate/void/src/ui/UserCard.tsx +15 -8
- package/templates/fate/void/translations/de-DE.json +863 -0
- package/templates/fate/void/translations/ja-JP.json +863 -0
- package/templates/fate/void/vite.config.ts +6 -6
- package/templates/fate/prisma/client/translations/de_DE.json +0 -689
- package/templates/fate/prisma/client/translations/ja_JP.json +0 -689
|
@@ -4,14 +4,16 @@ export default function Error({ error: initialError }: { error: unknown }) {
|
|
|
4
4
|
const error = initialError instanceof Error ? (initialError as Error) : null;
|
|
5
5
|
return (
|
|
6
6
|
<VStack gap={12}>
|
|
7
|
-
<h3 className="text-xl font-semibold text-red-700">
|
|
7
|
+
<h3 className="text-xl font-semibold text-red-700">
|
|
8
|
+
<fbt desc="Error: Error">Error</fbt>
|
|
9
|
+
</h3>
|
|
8
10
|
<code>{error ? error.stack || `fate Error: ${error.message}` : String(initialError)}</code>
|
|
9
11
|
<div>
|
|
10
12
|
<a
|
|
11
13
|
className="cursor-pointer underline decoration-gray-300 hover:no-underline"
|
|
12
14
|
onClick={() => window.location.reload()}
|
|
13
15
|
>
|
|
14
|
-
Try again
|
|
16
|
+
<fbt desc="Try again button">Try again</fbt>{' '}
|
|
15
17
|
</a>
|
|
16
18
|
</div>
|
|
17
19
|
</VStack>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Stack, { VStack } from '@nkzw/stack';
|
|
2
|
+
import { fbs } from 'fbtee';
|
|
2
3
|
import { ArrowUpRight, CalendarDays, MapPin, Users } from 'lucide-react';
|
|
3
4
|
import { useEffect, useState } from 'react';
|
|
4
5
|
import { useView, view, ViewRef } from 'react-fate';
|
|
@@ -41,7 +42,7 @@ const EventAttendeeChip = ({ attendee: attendeeRef }: { attendee: ViewRef<'Event
|
|
|
41
42
|
|
|
42
43
|
return (
|
|
43
44
|
<Badge className="text-nowrap" key={attendee.id} variant="outline">
|
|
44
|
-
{user?.name ?? 'Guest'} · {formatLabel(attendee.status)}
|
|
45
|
+
{user?.name ?? fbs('Guest', 'Unnamed event attendee')} · {formatLabel(attendee.status)}
|
|
45
46
|
</Badge>
|
|
46
47
|
);
|
|
47
48
|
};
|
|
@@ -110,12 +111,22 @@ export default function EventCard({ event: eventRef }: { event: ViewRef<'Event'>
|
|
|
110
111
|
<Stack alignCenter gap>
|
|
111
112
|
<Users className="text-muted-foreground" size={14} />
|
|
112
113
|
<span className="text-sm text-foreground/80">
|
|
113
|
-
|
|
114
|
+
<fbt desc="Event attendance and capacity">
|
|
115
|
+
<fbt:param name="attending">{event.attendingCount ?? attendees.length}</fbt:param>{' '}
|
|
116
|
+
attending · capacity <fbt:param name="capacity">{event.capacity}</fbt:param>
|
|
117
|
+
</fbt>
|
|
114
118
|
</span>
|
|
115
119
|
</Stack>
|
|
116
120
|
<Stack alignCenter gap>
|
|
117
121
|
<ArrowUpRight className="text-muted-foreground" size={14} />
|
|
118
|
-
<span className="text-sm text-foreground/80">
|
|
122
|
+
<span className="text-sm text-foreground/80">
|
|
123
|
+
<fbt desc="Event host">
|
|
124
|
+
Hosted by{' '}
|
|
125
|
+
<fbt:param name="host">
|
|
126
|
+
{host?.name ?? fbs('Unknown', 'Unknown event host')}
|
|
127
|
+
</fbt:param>
|
|
128
|
+
</fbt>
|
|
129
|
+
</span>
|
|
119
130
|
</Stack>
|
|
120
131
|
{topics.length ? (
|
|
121
132
|
<Stack gap wrap>
|
|
@@ -128,7 +139,9 @@ export default function EventCard({ event: eventRef }: { event: ViewRef<'Event'>
|
|
|
128
139
|
) : null}
|
|
129
140
|
{attendees.length ? (
|
|
130
141
|
<VStack gap>
|
|
131
|
-
<span className="text-xs text-muted-foreground">
|
|
142
|
+
<span className="text-xs text-muted-foreground">
|
|
143
|
+
<fbt desc="EventCard: Community RSVPs">Community RSVPs</fbt>
|
|
144
|
+
</span>
|
|
132
145
|
<Stack gap wrap>
|
|
133
146
|
{attendees.slice(0, 4).map(({ node }) => (
|
|
134
147
|
<EventAttendeeChip attendee={node} key={node.id} />
|
|
@@ -143,7 +156,7 @@ export default function EventCard({ event: eventRef }: { event: ViewRef<'Event'>
|
|
|
143
156
|
rel="noreferrer"
|
|
144
157
|
target="_blank"
|
|
145
158
|
>
|
|
146
|
-
Join livestream
|
|
159
|
+
<fbt desc="EventCard: Join livestream">Join livestream</fbt>{' '}
|
|
147
160
|
</a>
|
|
148
161
|
) : null}
|
|
149
162
|
</VStack>
|
|
@@ -5,6 +5,7 @@ import type { SharedData } from '../lib/shared.ts';
|
|
|
5
5
|
import AuthClient from '../user/AuthClient.tsx';
|
|
6
6
|
import { Button } from './Button.tsx';
|
|
7
7
|
import Link from './Link.tsx';
|
|
8
|
+
import LocaleSwitcher from './LocaleSwitcher.tsx';
|
|
8
9
|
|
|
9
10
|
export default function Header() {
|
|
10
11
|
const router = useRouter();
|
|
@@ -51,16 +52,19 @@ export default function Header() {
|
|
|
51
52
|
<span className="italic">fate</span>
|
|
52
53
|
</span>
|
|
53
54
|
<p className="hidden text-xs text-muted-foreground sm:block">
|
|
54
|
-
A modern data client for React
|
|
55
|
+
<fbt desc="fate library tagline">A modern data client for React.</fbt>{' '}
|
|
55
56
|
</p>
|
|
56
57
|
</div>
|
|
57
58
|
</Stack>
|
|
58
59
|
</Link>
|
|
59
60
|
<Stack alignCenter>
|
|
61
|
+
<LocaleSwitcher />
|
|
60
62
|
<Button asChild size="sm" variant="ghost">
|
|
61
63
|
<Link href="/search">
|
|
62
64
|
<Search className="h-4 w-4" />
|
|
63
|
-
<span className="hidden sm:inline">
|
|
65
|
+
<span className="hidden sm:inline">
|
|
66
|
+
<fbt desc="Search button">Search</fbt>
|
|
67
|
+
</span>
|
|
64
68
|
</Link>
|
|
65
69
|
</Button>
|
|
66
70
|
<div className="flex w-9 justify-end sm:w-24">
|
|
@@ -78,13 +82,15 @@ export default function Header() {
|
|
|
78
82
|
}}
|
|
79
83
|
>
|
|
80
84
|
<LogOut className="h-4 w-4" />
|
|
81
|
-
<span className="hidden sm:inline">
|
|
85
|
+
<span className="hidden sm:inline">
|
|
86
|
+
<fbt desc="Logout button">Logout</fbt>
|
|
87
|
+
</span>
|
|
82
88
|
</Stack>
|
|
83
89
|
</Button>
|
|
84
90
|
) : (
|
|
85
91
|
<Button asChild className="w-full" size="sm" variant="ghost">
|
|
86
92
|
<Link href="/login">
|
|
87
|
-
<LogIn className="h-4 w-4" /> Login
|
|
93
|
+
<LogIn className="h-4 w-4" /> <fbt desc="Login button">Login</fbt>{' '}
|
|
88
94
|
</Link>
|
|
89
95
|
</Button>
|
|
90
96
|
)}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useLocaleContext } from 'fbtee';
|
|
2
|
+
import { startTransition } from 'react';
|
|
3
|
+
import AvailableLanguages from '../lib/AvailableLanguages.tsx';
|
|
4
|
+
|
|
5
|
+
export default function LocaleSwitcher() {
|
|
6
|
+
const { locale, localeChangeIsPending, setLocale } = useLocaleContext();
|
|
7
|
+
return (
|
|
8
|
+
<label className="inline-flex items-center gap-2 text-sm">
|
|
9
|
+
<span className="sr-only">
|
|
10
|
+
<fbt desc="Locale switcher button">Change Language</fbt>
|
|
11
|
+
</span>
|
|
12
|
+
<select
|
|
13
|
+
className="rounded-md border border-gray-300 bg-background px-2 py-1 text-foreground"
|
|
14
|
+
disabled={localeChangeIsPending}
|
|
15
|
+
onChange={(event) => {
|
|
16
|
+
const nextLocale = event.target.value;
|
|
17
|
+
try {
|
|
18
|
+
localStorage.setItem('fbtee:locale', nextLocale);
|
|
19
|
+
} catch {
|
|
20
|
+
// Changing the language still works without browser storage.
|
|
21
|
+
}
|
|
22
|
+
startTransition(() => setLocale(nextLocale));
|
|
23
|
+
}}
|
|
24
|
+
value={locale}
|
|
25
|
+
>
|
|
26
|
+
{[...AvailableLanguages].map(([value, name]) => (
|
|
27
|
+
<option key={value} value={value}>
|
|
28
|
+
{name}
|
|
29
|
+
</option>
|
|
30
|
+
))}
|
|
31
|
+
</select>
|
|
32
|
+
</label>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Stack, { VStack } from '@nkzw/stack';
|
|
2
2
|
import { useShared } from '@void/react';
|
|
3
3
|
import { cx } from 'class-variance-authority';
|
|
4
|
+
import { fbs } from 'fbtee';
|
|
4
5
|
import {
|
|
5
6
|
KeyboardEvent,
|
|
6
7
|
Suspense,
|
|
@@ -79,7 +80,7 @@ const PostComments = ({
|
|
|
79
80
|
))}
|
|
80
81
|
{loadNext ? (
|
|
81
82
|
<Button onClick={loadNext} variant="ghost">
|
|
82
|
-
Load more comments
|
|
83
|
+
<fbt desc="Load more comments button">Load more comments</fbt>{' '}
|
|
83
84
|
</Button>
|
|
84
85
|
) : null}
|
|
85
86
|
</VStack>
|
|
@@ -136,25 +137,29 @@ const CommentInput = ({
|
|
|
136
137
|
|
|
137
138
|
return (
|
|
138
139
|
<VStack action={addComment} as="form" gap>
|
|
139
|
-
<span className="text-sm font-medium text-foreground">
|
|
140
|
+
<span className="text-sm font-medium text-foreground">
|
|
141
|
+
<fbt desc="Comment add label">Add a comment</fbt>
|
|
142
|
+
</span>
|
|
140
143
|
<textarea
|
|
141
144
|
className="squircle min-h-20 w-full border border-gray-200/80 bg-gray-100/50 p-3 text-sm placeholder-gray-500 transition outline-none focus:border-gray-500 focus:ring-2 focus:ring-gray-200 disabled:opacity-50 dark:border-neutral-800 dark:bg-neutral-900/40 dark:placeholder-gray-400"
|
|
142
145
|
disabled={isPending}
|
|
143
146
|
onChange={(event) => setCommentText(event.target.value)}
|
|
144
147
|
onKeyDown={maybeSubmitComment}
|
|
145
|
-
placeholder={
|
|
148
|
+
placeholder={fbs('Share your thoughts...', 'Placeholder text for comment input')}
|
|
146
149
|
value={commentText}
|
|
147
150
|
/>
|
|
148
151
|
{anyServerError ? (
|
|
149
152
|
<p className="text-sm text-destructive">
|
|
150
|
-
{anyServerError instanceof Error
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
{anyServerError instanceof Error ? (
|
|
154
|
+
anyServerError.message
|
|
155
|
+
) : (
|
|
156
|
+
<fbt desc="Error text">Something went wrong. Please try again.</fbt>
|
|
157
|
+
)}
|
|
153
158
|
</p>
|
|
154
159
|
) : null}
|
|
155
160
|
<Stack end gap>
|
|
156
161
|
<Button disabled={commentingIsDisabled} size="sm" type="submit" variant="secondary">
|
|
157
|
-
Post comment
|
|
162
|
+
<fbt desc="Post comment button">Post comment</fbt>{' '}
|
|
158
163
|
</Button>
|
|
159
164
|
</Stack>
|
|
160
165
|
</VStack>
|
|
@@ -237,7 +242,7 @@ export function PostCard({ detail, post: postRef }: { detail?: boolean; post: Vi
|
|
|
237
242
|
</span>
|
|
238
243
|
</Stack>
|
|
239
244
|
<Button action={handleLike} disabled={likeIsPending} size="sm" variant="outline">
|
|
240
|
-
Like
|
|
245
|
+
<fbt desc="Like button">Like</fbt>{' '}
|
|
241
246
|
</Button>
|
|
242
247
|
{detail && (
|
|
243
248
|
<Button
|
|
@@ -246,7 +251,7 @@ export function PostCard({ detail, post: postRef }: { detail?: boolean; post: Vi
|
|
|
246
251
|
size="sm"
|
|
247
252
|
variant="outline"
|
|
248
253
|
>
|
|
249
|
-
Like (Slow)
|
|
254
|
+
<fbt desc="Like button with a slow request">Like (Slow)</fbt>{' '}
|
|
250
255
|
</Button>
|
|
251
256
|
)}
|
|
252
257
|
{detail && (
|
|
@@ -260,7 +265,11 @@ export function PostCard({ detail, post: postRef }: { detail?: boolean; post: Vi
|
|
|
260
265
|
size="sm"
|
|
261
266
|
variant="outline"
|
|
262
267
|
>
|
|
263
|
-
{likeResult?.error ?
|
|
268
|
+
{likeResult?.error ? (
|
|
269
|
+
<fbt desc="Very short error messages">Oops, try again!</fbt>
|
|
270
|
+
) : (
|
|
271
|
+
<fbt desc="Like button that triggers an error">Like (Error)</fbt>
|
|
272
|
+
)}
|
|
264
273
|
</Button>
|
|
265
274
|
)}
|
|
266
275
|
{detail && (
|
|
@@ -270,7 +279,9 @@ export function PostCard({ detail, post: postRef }: { detail?: boolean; post: Vi
|
|
|
270
279
|
size="sm"
|
|
271
280
|
variant="outline"
|
|
272
281
|
>
|
|
273
|
-
Like
|
|
282
|
+
<fbt desc="Like button that triggers a network error">
|
|
283
|
+
Like (Network Error)
|
|
284
|
+
</fbt>{' '}
|
|
274
285
|
</Button>
|
|
275
286
|
)}
|
|
276
287
|
{detail && (
|
|
@@ -285,7 +296,7 @@ export function PostCard({ detail, post: postRef }: { detail?: boolean; post: Vi
|
|
|
285
296
|
size="sm"
|
|
286
297
|
variant="outline"
|
|
287
298
|
>
|
|
288
|
-
Like (Many)
|
|
299
|
+
<fbt desc="Like button that can be pressed many times">Like (Many)</fbt>{' '}
|
|
289
300
|
</Button>
|
|
290
301
|
)}
|
|
291
302
|
<Button
|
|
@@ -294,7 +305,7 @@ export function PostCard({ detail, post: postRef }: { detail?: boolean; post: Vi
|
|
|
294
305
|
size="sm"
|
|
295
306
|
variant="outline"
|
|
296
307
|
>
|
|
297
|
-
Unlike
|
|
308
|
+
<fbt desc="Unlike button">Unlike</fbt>{' '}
|
|
298
309
|
</Button>
|
|
299
310
|
</Stack>
|
|
300
311
|
</Stack>
|
|
@@ -302,7 +313,11 @@ export function PostCard({ detail, post: postRef }: { detail?: boolean; post: Vi
|
|
|
302
313
|
<p className="text-sm text-muted-foreground">- {author?.name ?? 'Unknown author'}</p>
|
|
303
314
|
<VStack gap={16}>
|
|
304
315
|
<h4 className="text-base font-semibold text-foreground">
|
|
305
|
-
|
|
316
|
+
<fbt desc="Comment headline">
|
|
317
|
+
<fbt:plural count={post.commentCount} many="Comments" showCount="ifMany">
|
|
318
|
+
One Comment
|
|
319
|
+
</fbt:plural>
|
|
320
|
+
</fbt>
|
|
306
321
|
</h4>
|
|
307
322
|
<Suspense fallback={null}>
|
|
308
323
|
<PostComments comments={post.comments} post={post} />
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import safeParse from '@nkzw/core/safeParse.js';
|
|
2
2
|
import Stack, { VStack } from '@nkzw/stack';
|
|
3
|
+
import { fbs } from 'fbtee';
|
|
3
4
|
import { ChangeEvent, useActionState, useState } from 'react';
|
|
4
5
|
import { useFateClient, useView, view, ViewRef } from 'react-fate';
|
|
5
6
|
import { User } from '../fate/server.ts';
|
|
@@ -68,7 +69,7 @@ const UserNameForm = ({ user }: { user: SessionUser }) => {
|
|
|
68
69
|
(error instanceof Error &&
|
|
69
70
|
error.message &&
|
|
70
71
|
safeParse<Array<{ message: string }>>(error.message)?.[0]?.message) ||
|
|
71
|
-
'Failed to update user name.',
|
|
72
|
+
fbs('Failed to update user name.', 'User name update error'),
|
|
72
73
|
);
|
|
73
74
|
}
|
|
74
75
|
}, null);
|
|
@@ -80,9 +81,11 @@ const UserNameForm = ({ user }: { user: SessionUser }) => {
|
|
|
80
81
|
return (
|
|
81
82
|
<div>
|
|
82
83
|
<VStack action={submitAction} as="form" gap={12}>
|
|
83
|
-
<h3 className="font-semibold">
|
|
84
|
+
<h3 className="font-semibold">
|
|
85
|
+
<fbt desc="Headline for update name section">Update Name</fbt>
|
|
86
|
+
</h3>
|
|
84
87
|
<label className="sr-only" htmlFor="header-username">
|
|
85
|
-
Username
|
|
88
|
+
<fbt desc="Username label">Username</fbt>{' '}
|
|
86
89
|
</label>
|
|
87
90
|
<Input
|
|
88
91
|
aria-describedby={error ? 'header-username-error' : undefined}
|
|
@@ -92,13 +95,13 @@ const UserNameForm = ({ user }: { user: SessionUser }) => {
|
|
|
92
95
|
id="header-username"
|
|
93
96
|
name="name"
|
|
94
97
|
onChange={handleChange}
|
|
95
|
-
placeholder=
|
|
98
|
+
placeholder={fbs('Name', 'UserCard: placeholder')}
|
|
96
99
|
title={error ?? undefined}
|
|
97
100
|
value={name}
|
|
98
101
|
/>
|
|
99
102
|
<div>
|
|
100
103
|
<Button disabled={isSaveDisabled} size="sm" type="submit" variant="secondary">
|
|
101
|
-
Save
|
|
104
|
+
<fbt desc="Button for saving">Save</fbt>{' '}
|
|
102
105
|
</Button>
|
|
103
106
|
</div>
|
|
104
107
|
</VStack>
|
|
@@ -114,11 +117,15 @@ export default function UserCard({ viewer: viewerRef }: { viewer: ViewRef<'User'
|
|
|
114
117
|
<Card>
|
|
115
118
|
<VStack between className="h-full" gap={16}>
|
|
116
119
|
<VStack gap={16}>
|
|
117
|
-
<H2>
|
|
120
|
+
<H2>
|
|
121
|
+
<fbt desc="Your account headline">Your account</fbt>
|
|
122
|
+
</H2>
|
|
118
123
|
<Stack alignCenter between gap={16}>
|
|
119
124
|
<p className="text-sm text-muted-foreground">
|
|
120
|
-
Signed in
|
|
121
|
-
|
|
125
|
+
<fbt desc="Signed in user">
|
|
126
|
+
Signed in as <fbt:param name="name">{viewer.name}</fbt:param>
|
|
127
|
+
<fbt:param name="email">{viewer.email ? ` <${viewer.email}>` : ''}</fbt:param>.
|
|
128
|
+
</fbt>
|
|
122
129
|
</p>
|
|
123
130
|
</Stack>
|
|
124
131
|
</VStack>
|