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")} - - -