import { GmstnLogoColor } from "@/components/icons/gmstn/GmstnLogoColor"; import { Text } from "@/components/primitives/Text"; import { useFacet } from "@/lib/facet"; import { lighten } from "@/lib/facet/src/lib/colors"; import { useOAuthSetter, useOAuthValue } from "@/providers/OAuthProvider"; import { useCurrentPalette } from "@/providers/ThemeProvider"; import { Agent } from "@atproto/api"; import { ArrowRight } from "lucide-react-native"; import { useState } from "react"; import { Pressable, TextInput, View } from "react-native"; export const Login = () => { const { semantic } = useCurrentPalette(); const { atoms, typography } = useFacet(); const [atprotoHandle, setAtprotoHandle] = useState(""); const oAuth = useOAuthValue(); const setOAuth = useOAuthSetter(); const providedOAuthClient = oAuth.client; const handlePress = async () => { const session = await providedOAuthClient.signIn(atprotoHandle); const agent = new Agent(session); setOAuth({ session, agent, client: providedOAuthClient, isLoading: false, }); }; const handleSubmit = () => { handlePress() .then() .catch((e: unknown) => { console.log(e); }); }; return ( Gemstone {({ hovered }) => ( Log in with ATProto )} ); };