fix: add signup form

fix/authentication
Arik Chakma 10 months ago
parent 19f5885e62
commit fce5545b60
  1. 18
      src/components/AuthenticationFlow/AuthenticationForm.tsx
  2. 2
      src/pages/signup.astro

@ -3,8 +3,15 @@ import { GitHubButton } from './GitHubButton';
import { GoogleButton } from './GoogleButton'; import { GoogleButton } from './GoogleButton';
import { LinkedInButton } from './LinkedInButton'; import { LinkedInButton } from './LinkedInButton';
import { EmailLoginForm } from './EmailLoginForm'; import { EmailLoginForm } from './EmailLoginForm';
import { EmailSignupForm } from './EmailSignupForm';
type AuthenticationFormProps = {
type?: 'login' | 'signup';
};
export function AuthenticationForm(props: AuthenticationFormProps) {
const { type = 'login' } = props;
export function AuthenticationForm() {
const [isDisabled, setIsDisabled] = useState(false); const [isDisabled, setIsDisabled] = useState(false);
return ( return (
@ -21,7 +28,14 @@ export function AuthenticationForm() {
<div className="h-px w-full bg-slate-200" /> <div className="h-px w-full bg-slate-200" />
</div> </div>
<EmailLoginForm isDisabled={isDisabled} setIsDisabled={setIsDisabled} /> {type === 'login' ? (
<EmailLoginForm isDisabled={isDisabled} setIsDisabled={setIsDisabled} />
) : (
<EmailSignupForm
isDisabled={isDisabled}
setIsDisabled={setIsDisabled}
/>
)}
</> </>
); );
} }

@ -25,7 +25,7 @@ import AccountLayout from '../layouts/AccountLayout.astro';
</p> </p>
</div> </div>
<AuthenticationForm client:load /> <AuthenticationForm type='signup' client:load />
<div class='mt-6 text-center text-sm text-slate-600'> <div class='mt-6 text-center text-sm text-slate-600'>
Already have an account? <a Already have an account? <a

Loading…
Cancel
Save