sign-up.tsx 1.8 KB

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