Revert "remove email signup for now"

This reverts commit 0e9c3a07fd.
This commit is contained in:
Gilbert 2024-06-04 16:26:15 -05:00
parent 8f7fc888a9
commit bfb4a3f30b

View File

@ -1,20 +1,26 @@
import { Button } from 'components/shared/Button'; import { Button } from 'components/shared/Button';
import { GithubIcon, LoaderIcon } from 'components/shared/CustomIcon'; import {
ArrowRightCircleFilledIcon,
GithubIcon,
LoaderIcon,
} from 'components/shared/CustomIcon';
import { GoogleIcon } from 'components/shared/CustomIcon/GoogleIcon'; import { GoogleIcon } from 'components/shared/CustomIcon/GoogleIcon';
import { DotBorder } from 'components/shared/DotBorder';
import { WavyBorder } from 'components/shared/WavyBorder'; import { WavyBorder } from 'components/shared/WavyBorder';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { useSnowball } from 'utils/use-snowball'; import { useSnowball } from 'utils/use-snowball';
import { Input } from 'components/shared/Input';
import { AppleIcon } from 'components/shared/CustomIcon/AppleIcon'; import { AppleIcon } from 'components/shared/CustomIcon/AppleIcon';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { useToast } from 'components/shared/Toast'; import { useToast } from 'components/shared/Toast';
import { PKPEthersWallet } from '@lit-protocol/pkp-ethers'; import { PKPEthersWallet } from '@lit-protocol/pkp-ethers';
import { signInWithEthereum } from 'utils/siwe'; import { signInWithEthereum } from 'utils/siwe';
import { logError } from 'utils/log-error'; import { logError } from 'utils/log-error';
// import { import {
// subOrganizationIdForEmail, subOrganizationIdForEmail,
// turnkeySignin, turnkeySignin,
// turnkeySignup, turnkeySignup,
// } from 'utils/turnkey-frontend'; } from 'utils/turnkey-frontend';
type Provider = 'google' | 'github' | 'apple' | 'email'; type Provider = 'google' | 'github' | 'apple' | 'email';
@ -25,7 +31,7 @@ type Props = {
}; };
export const SignUp = ({ onDone }: Props) => { export const SignUp = ({ onDone }: Props) => {
// const [email, setEmail] = useState(''); const [email, setEmail] = useState('');
const [error, setError] = useState<Err | null>(); const [error, setError] = useState<Err | null>();
const [provider, setProvider] = useState<Provider | false>(false); const [provider, setProvider] = useState<Provider | false>(false);
@ -81,29 +87,29 @@ export const SignUp = ({ onDone }: Props) => {
} }
} }
// async function authEmail() { async function authEmail() {
// setProvider('email'); setProvider('email');
// try { try {
// const orgId = await subOrganizationIdForEmail(email); const orgId = await subOrganizationIdForEmail(email);
// console.log('orgId', orgId); console.log('orgId', orgId);
// if (orgId) { if (orgId) {
// await turnkeySignin(orgId); await turnkeySignin(orgId);
// window.location.href = '/dashboard'; window.location.href = '/dashboard';
// } else { } else {
// await turnkeySignup(email); await turnkeySignup(email);
// onDone(); onDone();
// } }
// } catch (err: any) { } catch (err: any) {
// setError({ type: 'email', message: err.message }); setError({ type: 'email', message: err.message });
// } }
// } }
useEffect(() => { useEffect(() => {
handleSignupRedirect(); handleSignupRedirect();
}, []); }, []);
const loading = provider; const loading = provider;
// const emailValid = /.@./.test(email); const emailValid = /.@./.test(email);
return ( return (
<div> <div>
@ -193,16 +199,16 @@ export const SignUp = ({ onDone }: Props) => {
</div> </div>
)} )}
{/* <div className="self-stretch justify-start items-center gap-8 inline-flex"> <div className="self-stretch justify-start items-center gap-8 inline-flex">
<DotBorder className="flex-1" /> <DotBorder className="flex-1" />
<div className="text-center text-slate-400 text-xs font-normal font-['JetBrains Mono'] leading-none"> <div className="text-center text-slate-400 text-xs font-normal font-['JetBrains Mono'] leading-none">
OR OR
</div> </div>
<DotBorder className="flex-1" /> <DotBorder className="flex-1" />
</div> */} </div>
<div className="self-stretch flex-col gap-8 flex"> <div className="self-stretch flex-col gap-8 flex">
{/* <div className="flex-col justify-start items-start gap-2 inline-flex"> <div className="flex-col justify-start items-start gap-2 inline-flex">
<div className="text-sky-950 text-sm font-normal font-['Inter'] leading-tight"> <div className="text-sky-950 text-sm font-normal font-['Inter'] leading-tight">
Email Email
</div> </div>
@ -211,8 +217,8 @@ export const SignUp = ({ onDone }: Props) => {
onChange={(e) => setEmail(e.target.value)} onChange={(e) => setEmail(e.target.value)}
disabled={!!loading} disabled={!!loading}
/> />
</div> */} </div>
{/* <Button <Button
rightIcon={ rightIcon={
loading && loading === 'email' ? ( loading && loading === 'email' ? (
<LoaderIcon className="animate-spin" /> <LoaderIcon className="animate-spin" />
@ -227,7 +233,7 @@ export const SignUp = ({ onDone }: Props) => {
disabled={!email || !emailValid || !!loading} disabled={!email || !emailValid || !!loading}
> >
Continue with Email Continue with Email
</Button> */} </Button>
<div className="flex flex-col gap-3"> <div className="flex flex-col gap-3">
{error && error.type === 'email' && ( {error && error.type === 'email' && (
<div className="justify-center items-center gap-2 inline-flex"> <div className="justify-center items-center gap-2 inline-flex">