diff --git a/apps/mobile/src/contexts/LoginTeamsContext.tsx b/apps/mobile/src/contexts/LoginTeamsContext.tsx deleted file mode 100644 index f79b2b18b..000000000 --- a/apps/mobile/src/contexts/LoginTeamsContext.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { createContext } from "react" - -export const LoginTeamsCheckedContext = createContext(__DEV__) - -export const LoginTeamsCheckGuardContext = createContext<((callback: () => void) => void) | null>( - () => {}, -) diff --git a/apps/mobile/src/contexts/LoginTermsContext.tsx b/apps/mobile/src/contexts/LoginTermsContext.tsx new file mode 100644 index 000000000..9048ca413 --- /dev/null +++ b/apps/mobile/src/contexts/LoginTermsContext.tsx @@ -0,0 +1,7 @@ +import { createContext } from "react" + +export const LoginTermsCheckedContext = createContext(__DEV__) + +export const LoginTermsCheckGuardContext = createContext<((callback: () => void) => void) | null>( + () => {}, +) diff --git a/apps/mobile/src/modules/login/email.tsx b/apps/mobile/src/modules/login/email.tsx index 42cfe68f4..0db4363ee 100644 --- a/apps/mobile/src/modules/login/email.tsx +++ b/apps/mobile/src/modules/login/email.tsx @@ -17,7 +17,7 @@ import { z } from "zod" import { ReAnimatedPressable } from "@/src/components/common/AnimatedComponents" import { ThemedText } from "@/src/components/common/ThemedText" -import { LoginTeamsCheckGuardContext } from "@/src/contexts/LoginTeamsContext" +import { LoginTermsCheckGuardContext } from "@/src/contexts/LoginTermsContext" import { signIn } from "@/src/lib/auth" import { toast } from "@/src/lib/toast" import { accentColor, useColor } from "@/src/theme/colors" @@ -76,9 +76,9 @@ export function EmailLogin() { mutationFn: onSubmit, }) - const teamsCheckGuard = useContext(LoginTeamsCheckGuardContext) + const termsCheckGuard = useContext(LoginTermsCheckGuardContext) const login = handleSubmit((values) => { - teamsCheckGuard?.(() => submitMutation.mutate(values)) + termsCheckGuard?.(() => submitMutation.mutate(values)) }) const disableColor = useColor("gray3") diff --git a/apps/mobile/src/modules/login/index.tsx b/apps/mobile/src/modules/login/index.tsx index 7edb30d5a..dfe7a4a51 100644 --- a/apps/mobile/src/modules/login/index.tsx +++ b/apps/mobile/src/modules/login/index.tsx @@ -14,12 +14,12 @@ import * as ContextMenu from "zeego/context-menu" import { ThemedText } from "@/src/components/common/ThemedText" import { Logo } from "@/src/components/ui/logo" import { - LoginTeamsCheckedContext, - LoginTeamsCheckGuardContext, -} from "@/src/contexts/LoginTeamsContext" + LoginTermsCheckedContext, + LoginTermsCheckGuardContext, +} from "@/src/contexts/LoginTermsContext" import { isIOS } from "@/src/lib/platform" import { toast } from "@/src/lib/toast" -import { TeamsMarkdown } from "@/src/screens/(headless)/terms" +import { TermsMarkdown } from "@/src/screens/(headless)/terms" import { EmailLogin } from "./email" import { SocialLogin } from "./social" @@ -27,10 +27,10 @@ import { SocialLogin } from "./social" export function Login() { const [isChecked, setIsChecked] = useState(false) - const teamsCheckBoxRef = useRef<{ shake: () => void }>(null) + const termsCheckBoxRef = useRef<{ shake: () => void }>(null) return ( - - + void) => { if (isChecked) { @@ -38,7 +38,7 @@ export function Login() { } else { toast.info("Please accept the Terms of Service and Privacy Policy") - teamsCheckBoxRef.current?.shake() + termsCheckBoxRef.current?.shake() } }, [isChecked], @@ -57,7 +57,7 @@ export function Login() { - + @@ -68,12 +68,12 @@ export function Login() { - - + + ) } -const TeamsCheckBox = forwardRef< +const TermsCheckBox = forwardRef< { shake: () => void }, { isChecked: boolean @@ -108,10 +108,11 @@ const TeamsCheckBox = forwardRef< return ( } + textComponent={} onLongPress={() => { if (!isIOS) { router.push("/terms") @@ -122,10 +123,10 @@ const TeamsCheckBox = forwardRef< ) }) -const TeamsText = () => { +const TermsText = () => { return ( - + I agree to the Terms of Service and Privacy Policy @@ -139,8 +140,8 @@ const TeamsText = () => { }, [])} > {() => ( - - + + )} diff --git a/apps/mobile/src/modules/login/social.tsx b/apps/mobile/src/modules/login/social.tsx index 6938682b6..c772825ab 100644 --- a/apps/mobile/src/modules/login/social.tsx +++ b/apps/mobile/src/modules/login/social.tsx @@ -3,7 +3,7 @@ import { useColorScheme } from "nativewind" import { useContext } from "react" import { Platform, TouchableOpacity, View } from "react-native" -import { LoginTeamsCheckGuardContext } from "@/src/contexts/LoginTeamsContext" +import { LoginTermsCheckGuardContext as LoginTermsCheckGuardContext } from "@/src/contexts/LoginTermsContext" import { AppleCuteFiIcon } from "@/src/icons/apple_cute_fi" import { GithubCuteFiIcon } from "@/src/icons/github_cute_fi" import { GoogleCuteFiIcon } from "@/src/icons/google_cute_fi" @@ -40,7 +40,7 @@ const provider: Record< export function SocialLogin() { const { data } = useAuthProviders() - const teamsCheckGuard = useContext(LoginTeamsCheckGuardContext) + const termsCheckGuard = useContext(LoginTermsCheckGuardContext) const { colorScheme } = useColorScheme() return ( @@ -54,7 +54,7 @@ export function SocialLogin() { key={key} className="border-opaque-separator border-hairline rounded-full p-2" onPress={() => - teamsCheckGuard?.(async () => { + termsCheckGuard?.(async () => { if (!data?.[providerInfo.id]) return if (providerInfo.id === "apple") { diff --git a/apps/mobile/src/screens/(headless)/terms.tsx b/apps/mobile/src/screens/(headless)/terms.tsx index 667c95be1..d14f9eb39 100644 --- a/apps/mobile/src/screens/(headless)/terms.tsx +++ b/apps/mobile/src/screens/(headless)/terms.tsx @@ -82,7 +82,7 @@ Before contributing, ensure that you have read and understood our contributing g Follow takes your privacy seriously. As a user, you acknowledge that we may collect, store, and process your personal information, including your usage patterns and interactions with content. We are committed to ensuring that your data is handled securely and transparently. Please refer to our [Privacy Policy](#) for more information on how we collect, process, and protect your data. ` -export const TeamsMarkdown = () => { +export const TermsMarkdown = () => { return ( - + ) } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5e58b4148..1443ea903 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -707,6 +707,8 @@ importers: specifier: ^4.0.3 version: 4.0.3(h6skq47olxax7xbsaduxdbjqze) + apps/mobile/web-app: {} + apps/renderer: dependencies: '@dnd-kit/core':