Files
supabase/apps/docs/components/Navigation/NavigationMenu/useDropdownMenu.tsx
Danny White 59af339b8f fix(ui): standardise nav logout label to "Sign out" (#49874)
## What kind of change does this PR introduce?

Copy fix across nav dropdowns.

## What is the current behavior?

Authenticated nav dropdowns use mixed logout wording: Studio shows "Log
out", while www, docs, and learn show "Logout". Studio error flows
already use "Sign out".

| Before |
| --- |
| <img width="482" height="670" alt="CleanShot 2026-09-02 at 13 07
46@2x"
src="https://github.com/user-attachments/assets/d87b7c18-94c0-4c1c-917e-e17e4cb16dd3"
/> |

## What is the new behavior?

All four nav dropdowns use **Sign out**, matching the Sign in / Sign up
standard and the direction in
[DOCS-1328](https://linear.app/supabase/issue/DOCS-1328).

Related: [Slack
thread](https://supabase.slack.com/archives/C0429V78ACX/p1787081498302919)

## To test

Only Studio is possible to test (before merge) given how authentication
works across apps on staging:

1. **Studio** (`/dashboard`): open the account avatar dropdown. Confirm
the bottom item reads **Sign out**.
2. **www** (`supabase.com`): open the account avatar dropdown. Confirm
**Sign out**.
3. **docs** (`supabase.com/docs`): open the account avatar dropdown.
Confirm **Sign out**.
4. **learn** (`supabase.com/learn`): open the account avatar dropdown.
Confirm **Sign out**.
2026-09-03 10:34:14 +10:00

87 lines
2.0 KiB
TypeScript

'use client'
import type { User } from '@supabase/supabase-js'
import { isFeatureEnabled, logOut } from 'common'
import { Database, Globe, Home, LifeBuoy, LogOut, Settings, UserIcon } from 'lucide-react'
import type { menuItem } from 'ui-patterns/AuthenticatedDropdownMenu'
import { IconGitHub } from './MenuIcons'
const useDropdownMenu = (user: User | null) => {
const menu: menuItem[][] = [
[
{
label: user?.email ?? "You're logged in",
type: 'text',
icon: UserIcon,
},
{
label: 'Account Preferences',
icon: Settings,
href: 'https://supabase.com/dashboard/account/me',
},
{
label: 'All Projects',
icon: Database,
href: 'https://supabase.com/dashboard/projects',
},
],
[
isFeatureEnabled('docs:navigation_dropdown_links_home')
? {
label: 'Supabase.com',
icon: Globe,
href: 'https://supabase.com',
otherProps: {
target: '_blank',
rel: 'noreferrer noopener',
},
}
: {
label: 'Dashboard',
icon: Home,
href: '../dashboard',
},
{
label: 'GitHub',
icon: IconGitHub as any,
href: 'https://github.com/supabase/supabase',
otherProps: {
target: '_blank',
rel: 'noreferrer noopener',
},
},
{
label: 'Support',
icon: LifeBuoy,
href: 'https://supabase.com/support',
otherProps: {
target: '_blank',
rel: 'noreferrer noopener',
},
},
],
[
{
label: 'Theme',
type: 'theme',
},
],
[
{
label: 'Sign out',
type: 'button',
icon: LogOut,
onClick: async () => {
await logOut()
window.location.reload()
},
},
],
]
return menu
}
export default useDropdownMenu