ForgotPasswordLayout.tsx 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import { useTheme } from 'next-themes'
  2. import Image from 'next/legacy/image'
  3. import Link from 'next/link'
  4. import { PropsWithChildren } from 'react'
  5. import { cn } from 'ui'
  6. import { BASE_PATH } from '@/lib/constants'
  7. type ForgotPasswordLayoutProps = {
  8. heading?: string
  9. subheading?: string
  10. logoLinkToMarketingSite?: boolean
  11. showHeadings?: boolean
  12. className?: string
  13. }
  14. const ForgotPasswordLayout = ({
  15. heading,
  16. subheading,
  17. logoLinkToMarketingSite = false,
  18. showHeadings = true,
  19. className,
  20. children,
  21. }: PropsWithChildren<ForgotPasswordLayoutProps>) => {
  22. const { resolvedTheme } = useTheme()
  23. return (
  24. <div
  25. className={cn(
  26. 'min-h-screen flex-1 bg-studio flex flex-col gap-8 lg:gap-16 xl:gap-32',
  27. className
  28. )}
  29. >
  30. <div className="sticky top-0 mx-auto w-full max-w-7xl px-8 pt-6 sm:px-6 lg:px-8">
  31. <nav className="relative flex items-center justify-between sm:h-10">
  32. <div className="flex shrink-0 grow items-center lg:grow-0">
  33. <div className="flex w-full items-center justify-between md:w-auto">
  34. <Link href={logoLinkToMarketingSite ? 'https://supabase.com' : '/organizations'}>
  35. <Image
  36. src={
  37. resolvedTheme?.includes('dark')
  38. ? `${BASE_PATH}/img/briven-dark.svg`
  39. : `${BASE_PATH}/img/briven-light.svg`
  40. }
  41. alt=""
  42. height={24}
  43. width={120}
  44. />
  45. </Link>
  46. </div>
  47. </div>
  48. </nav>
  49. </div>
  50. <div className="flex flex-col justify-center items-center">
  51. <main className="max-w-[448px] w-full flex flex-col px-5">
  52. {showHeadings && (
  53. <div className="mb-6">
  54. <h1 className="lg:text-3xl mt-8 mb-2">{heading}</h1>
  55. <h2 className="text-foreground-light text-sm">{subheading}</h2>
  56. </div>
  57. )}
  58. {children}
  59. </main>
  60. </div>
  61. </div>
  62. )
  63. }
  64. export default ForgotPasswordLayout