function AuthShell({ title, subtitle, children, footer }) {
const wide = useWide();
return (
§ {title.toUpperCase()}
{subtitle}
Welcome. Let's get you set up — takes 30 seconds.
{children}
{footer}
);
}
function Field({ label, ...props }) {
return (
);
}
function Signup({ go, onAuth }) {
const [email, setEmail] = React.useState('');
const [pw, setPw] = React.useState('');
const [name, setName] = React.useState('');
const [walletState, setWalletState] = React.useState('idle'); // idle | connecting | connected
const [wallet, setWallet] = React.useState(null);
const submit = (e) => {
e && e.preventDefault();
if (!email || (!pw && !wallet)) return;
onAuth({ name: name || email.split('@')[0], email, wallet });
go('pricing');
};
const connect = () => {
setWalletState('connecting');
setTimeout(() => { setWallet('0x4A...9f2D'); setWalletState('connected'); }, 1100);
};
return (
Join the desk.>}
footer={
Already a member? go('login')} style={{ color: TH.accent, cursor: 'pointer' }}>Log in
}
>
);
}
function Login({ go, onAuth }) {
const [email, setEmail] = React.useState('');
const [pw, setPw] = React.useState('');
const submit = (e) => { e.preventDefault(); if (!email) return; onAuth({ name: email.split('@')[0], email }); go('home'); };
return (
Welcome back.>}
footer={
New here? go('signup')} style={{ color: TH.accent, cursor: 'pointer' }}>Create account
}
>
);
}
Object.assign(window, { Signup, Login });