mirror of
https://github.com/supabase/supabase.git
synced 2026-10-09 03:15:06 +03:00
* Minor clean ups * Clean up * Standardize more icon for table and storage editor * update copy
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { useRouter } from 'next/router'
|
|
import { PropsWithChildren } from 'react'
|
|
|
|
import { useParams } from 'common'
|
|
import { ProductMenu } from 'components/ui/ProductMenu'
|
|
import { useAuthConfigPrefetch } from 'data/auth/auth-config-query'
|
|
import { withAuth } from 'hooks/misc/withAuth'
|
|
import ProjectLayout from '../ProjectLayout/ProjectLayout'
|
|
import { generateAuthMenu } from './AuthLayout.utils'
|
|
|
|
const AuthProductMenu = () => {
|
|
const router = useRouter()
|
|
const { ref: projectRef = 'default' } = useParams()
|
|
|
|
useAuthConfigPrefetch({ projectRef })
|
|
const page = router.pathname.split('/')[4]
|
|
|
|
return <ProductMenu page={page} menu={generateAuthMenu(projectRef)} />
|
|
}
|
|
|
|
const AuthLayout = ({ children }: PropsWithChildren<{}>) => {
|
|
return (
|
|
<ProjectLayout
|
|
title="Authentication"
|
|
product="Authentication"
|
|
productMenu={<AuthProductMenu />}
|
|
isBlocking={false}
|
|
>
|
|
{children}
|
|
</ProjectLayout>
|
|
)
|
|
}
|
|
|
|
/**
|
|
* Layout for all auth pages on the dashboard, wrapped with withAuth to verify logged in state
|
|
*
|
|
* Handles rendering the navigation for each section under the auth pages.
|
|
*/
|
|
export default withAuth(AuthLayout)
|