From 0ec05835ff755b8d9833522e5320ccbed518a5a9 Mon Sep 17 00:00:00 2001 From: neodk2004 Date: Fri, 9 Oct 2026 07:14:32 +0200 Subject: [PATCH] feat(mobile): Einladungskarte, neue Einladen-Seite und Onboarding in kurzen Schritten MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - InviteCard in den Einstellungen und auf /invite: Rang (oder erster offener Rang gestrichelt), Code, animierter Fortschritt, Teilen - /invite: Ränge als Zeitleiste, Status-Etiketten bei eingeladenen Tieren - Onboarding: Willkommen (3 Regel-Karten + Bestätigungen), Name, Tierart- Chips, Beschreibung, Foto, Spinnen-Schalter, Herkunft, Abschluss mit Konfetti; Fortschritt, Zurück und Android-Zurück-Geste - Regeln als App-Texte: getPendingUpdate lieferte neuen Nutzern die ganze Änderungshistorie der Rechtstexte statt der Community-Regeln Co-Authored-By: Claude Opus 5.5 --- mobile/src/components/{auth => }/Reveal.tsx | 0 .../onboarding/OnboardingGuidelines.tsx | 107 ------------ .../components/onboarding/PetCreateForm.tsx | 152 ------------------ .../components/onboarding/UploadConsent.tsx | 135 ---------------- .../InviteCard.tsx} | 0 5 files changed, 394 deletions(-) rename mobile/src/components/{auth => }/Reveal.tsx (100%) delete mode 100644 mobile/src/components/onboarding/OnboardingGuidelines.tsx delete mode 100644 mobile/src/components/onboarding/PetCreateForm.tsx delete mode 100644 mobile/src/components/onboarding/UploadConsent.tsx rename mobile/src/components/{settings/InviteFriendsSection.tsx => referrals/InviteCard.tsx} (100%) diff --git a/mobile/src/components/auth/Reveal.tsx b/mobile/src/components/Reveal.tsx similarity index 100% rename from mobile/src/components/auth/Reveal.tsx rename to mobile/src/components/Reveal.tsx diff --git a/mobile/src/components/onboarding/OnboardingGuidelines.tsx b/mobile/src/components/onboarding/OnboardingGuidelines.tsx deleted file mode 100644 index 1bda3c4..0000000 --- a/mobile/src/components/onboarding/OnboardingGuidelines.tsx +++ /dev/null @@ -1,107 +0,0 @@ -import { View, Text, Pressable, ActivityIndicator, Linking, StyleSheet } from "react-native"; -import { useEffect, useMemo } from "react"; -import { useTranslation } from "react-i18next"; -import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; -import { ScrollText } from "lucide-react-native"; -import { useTRPC } from "../../api/trpc"; -import { env } from "../../lib/env"; -import { Button } from "../Button"; -import { radii, getTypography, type ColorTokens, type Typography } from "../../theme/tokens"; -import { useTheme } from "../../context/ThemeContext"; - -type Props = { onContinue: () => void }; - -/** - * Port of web's src/components/legal/OnboardingGuidelines.tsx. Auto-skips - * via onContinue() once acknowledged, or if nothing has ever been published - * (legal.getPendingUpdate returns null) — matches web's admin-editable - * LegalDocumentVersion content, not a hardcoded first-run screen. - */ -export function OnboardingGuidelines({ onContinue }: Props) { - const { t } = useTranslation(); - const { colors } = useTheme(); - const styles = useMemo(() => makeStyles(colors), [colors]); - const trpc = useTRPC(); - const queryClient = useQueryClient(); - - const { data: pending, isLoading } = useQuery(trpc.legal.getPendingUpdate.queryOptions()); - - const acknowledgeMutation = useMutation( - trpc.legal.acknowledge.mutationOptions({ - onSuccess: () => { - queryClient.invalidateQueries({ queryKey: trpc.legal.getPendingUpdate.queryOptions().queryKey }); - onContinue(); - }, - }) - ); - - const hasNothingToAcknowledge = !isLoading && (!pending || pending.length === 0); - - useEffect(() => { - if (hasNothingToAcknowledge) onContinue(); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [hasNothingToAcknowledge]); - - if (isLoading || hasNothingToAcknowledge) { - return ( - - - - ); - } - - return ( - - - - {t("onboarding.guidelinesTitle")} - - {t("onboarding.guidelinesSubtitle")} - - - {pending!.map((version) => ( - - {version.changeSummary} - - ))} - - - Linking.openURL(`${env.apiUrl}/nutzungsbedingungen`)}> - {t("onboarding.termsLink")} - - Linking.openURL(`${env.apiUrl}/datenschutz`)}> - {t("onboarding.privacyLink")} - - -