From dc344f11888d09c8c2128d7e867634e0095060a9 Mon Sep 17 00:00:00 2001 From: neodk2004 Date: Sat, 5 Sep 2026 11:51:17 +0200 Subject: [PATCH] feat(mobile): match PawFeed web design system, fix Clerk device trust MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add design tokens (colors, radii, typography) mirroring DESIGN.md's "Spotlight Porch" system, plus Button/TextField/Card components built on them. Restyle the sign-in and placeholder home screens to match. - Load Inter via @expo-google-fonts/inter, gate rendering on fonts + Clerk being ready instead of a blank screen. - Pin react-dom to match react's version — Metro/Hermes hard-require exact equality, and react-dom wasn't pinned anywhere before. - Handle Clerk's `needs_client_trust` status (Device Trust, tied to the dashboard's Native Applications API): send/verify an email code before finalizing sign-in. Verified end-to-end in the Android emulator against the live backend: sign-in, device-trust code verification, and the home screen showing real stats.getPublicStats data. --- mobile/app.json | 6 +- mobile/app/(app)/index.tsx | 39 ++++++------ mobile/app/(auth)/sign-in.tsx | 95 +++++++++++++++++++++++------ mobile/app/_layout.tsx | 44 +++++++++++-- mobile/package-lock.json | 18 ++++-- mobile/package.json | 3 + mobile/src/components/Button.tsx | 68 +++++++++++++++++++++ mobile/src/components/Card.tsx | 21 +++++++ mobile/src/components/TextField.tsx | 25 ++++++++ mobile/src/theme/tokens.ts | 89 +++++++++++++++++++++++++++ 10 files changed, 359 insertions(+), 49 deletions(-) create mode 100644 mobile/src/components/Button.tsx create mode 100644 mobile/src/components/Card.tsx create mode 100644 mobile/src/components/TextField.tsx create mode 100644 mobile/src/theme/tokens.ts diff --git a/mobile/app.json b/mobile/app.json index 281cb08..23d3c22 100644 --- a/mobile/app.json +++ b/mobile/app.json @@ -25,6 +25,10 @@ "web": { "favicon": "./assets/favicon.png" }, - "plugins": ["expo-router", "expo-secure-store"] + "plugins": [ + "expo-router", + "expo-secure-store", + "expo-font" + ] } } diff --git a/mobile/app/(app)/index.tsx b/mobile/app/(app)/index.tsx index 75609de..6d4d691 100644 --- a/mobile/app/(app)/index.tsx +++ b/mobile/app/(app)/index.tsx @@ -1,7 +1,10 @@ -import { View, Text, Pressable, StyleSheet, ActivityIndicator } from "react-native"; +import { View, Text, StyleSheet, ActivityIndicator } from "react-native"; import { useQuery } from "@tanstack/react-query"; import { useAuth, useUser } from "@clerk/expo"; import { useTRPC } from "../../src/api/trpc"; +import { Button } from "../../src/components/Button"; +import { Card } from "../../src/components/Card"; +import { colors, typography } from "../../src/theme/tokens"; /** * Placeholder home screen — its only job right now is to prove the mobile @@ -19,32 +22,34 @@ export default function HomeScreen() { Angemeldet als {user?.primaryEmailAddress?.emailAddress} - + Backend-Verbindung - {isLoading && } + {isLoading && } {error && {error.message}} {data && ( <> - Owner: {data.ownerCount} - Pets: {data.petCount} - Sponsoren: {data.sponsorCount} + Owner: {data.ownerCount} + Pets: {data.petCount} + Sponsoren: {data.sponsorCount} )} - + - signOut()}> - Abmelden - +