sign-up.tsx60 lines · main
1import Link from 'next/link'
2
3import { SignInWithGitHub } from '@/components/interfaces/SignIn/SignInWithGitHub'
4import { SignUpForm } from '@/components/interfaces/SignIn/SignUpForm'
5import SignInLayout from '@/components/layouts/SignInLayout/SignInLayout'
6import { UnknownInterface } from '@/components/ui/UnknownInterface'
7import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled'
8import type { NextPageWithLayout } from '@/types'
9
10const SignUpPage: NextPageWithLayout = () => {
11 const {
12 dashboardAuthSignUp: signUpEnabled,
13 dashboardAuthSignInWithGithub: signInWithGithubEnabled,
14 } = useIsFeatureEnabled(['dashboard_auth:sign_up', 'dashboard_auth:sign_in_with_github'])
15
16 if (!signUpEnabled) {
17 return <UnknownInterface fullHeight={false} urlBack="/sign-in" />
18 }
19
20 return (
21 <>
22 <div className="flex flex-col gap-5">
23 {signInWithGithubEnabled && (
24 <>
25 <SignInWithGitHub />
26
27 <div className="relative">
28 <div className="absolute inset-0 flex items-center">
29 <div className="w-full border-t border-strong" />
30 </div>
31 <div className="relative flex justify-center text-sm">
32 <span className="bg-studio px-2 text-sm text-foreground">or</span>
33 </div>
34 </div>
35 </>
36 )}
37
38 <SignUpForm />
39 </div>
40
41 <div className="my-8 self-center text-sm">
42 <span className="text-foreground-light">Have an account?</span>{' '}
43 <Link
44 href="/sign-in"
45 className="underline text-foreground hover:text-foreground-light transition"
46 >
47 Sign in
48 </Link>
49 </div>
50 </>
51 )
52}
53
54SignUpPage.getLayout = (page) => (
55 <SignInLayout heading="Get started" subheading="Create a new account">
56 {page}
57 </SignInLayout>
58)
59
60export default SignUpPage