mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 00:19:08 +00:00
## Context Just some housekeeping to move off old layout components - this PR targets Auth and Settings pages, specifically - Auth -> Emails - Auth -> Providers - Settings -> API Keys - Settings -> JWT Keys - Settings -> Log Drains - Settings -> Read Replica/id The only visual change is just that navigation tabs take the full width of the viewport now Just need to make sure that these pages still render fine
67 lines
1.9 KiB
TypeScript
67 lines
1.9 KiB
TypeScript
import { useParams } from 'common'
|
|
import Link from 'next/link'
|
|
import { usePathname } from 'next/navigation'
|
|
import { PropsWithChildren } from 'react'
|
|
import { NavMenu, NavMenuItem } from 'ui'
|
|
import {
|
|
PageHeader,
|
|
PageHeaderDescription,
|
|
PageHeaderMeta,
|
|
PageHeaderSummary,
|
|
PageHeaderTitle,
|
|
} from 'ui-patterns/PageHeader'
|
|
import { PageNav } from 'ui-patterns/PageNav'
|
|
|
|
import AuthLayout from './AuthLayout'
|
|
import { UnknownInterface } from '@/components/ui/UnknownInterface'
|
|
import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled'
|
|
|
|
export const AuthEmailsLayout = ({ children }: PropsWithChildren<{}>) => {
|
|
const { ref } = useParams()
|
|
const pathname = usePathname()
|
|
|
|
const showEmails = useIsFeatureEnabled('authentication:emails')
|
|
|
|
const navItems = [
|
|
{
|
|
label: 'Templates',
|
|
href: `/project/${ref}/auth/templates`,
|
|
},
|
|
{
|
|
label: 'SMTP Settings',
|
|
href: `/project/${ref}/auth/smtp`,
|
|
},
|
|
]
|
|
|
|
return (
|
|
<AuthLayout title="Emails">
|
|
{showEmails ? (
|
|
<>
|
|
<PageHeader>
|
|
<PageHeaderMeta>
|
|
<PageHeaderSummary>
|
|
<PageHeaderTitle>Emails</PageHeaderTitle>
|
|
<PageHeaderDescription>
|
|
Configure what emails your users receive and how they are sent
|
|
</PageHeaderDescription>
|
|
</PageHeaderSummary>
|
|
</PageHeaderMeta>
|
|
</PageHeader>
|
|
<PageNav size="default">
|
|
<NavMenu>
|
|
{navItems.map((item) => (
|
|
<NavMenuItem key={item.label} active={pathname === item.href}>
|
|
<Link href={item.href}>{item.label}</Link>
|
|
</NavMenuItem>
|
|
))}
|
|
</NavMenu>
|
|
</PageNav>
|
|
{children}
|
|
</>
|
|
) : (
|
|
<UnknownInterface urlBack={`/project/${ref}/auth/users`} />
|
|
)}
|
|
</AuthLayout>
|
|
)
|
|
}
|