mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
## 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**.
62 lines
1.4 KiB
TypeScript
62 lines
1.4 KiB
TypeScript
'use client'
|
|
|
|
import type { User } from '@supabase/supabase-js'
|
|
import { logOut } from 'common'
|
|
import { Command, Database, LogOut, Settings, UserIcon } from 'lucide-react'
|
|
import { useRouter } from 'next/compat/router'
|
|
import type { menuItem } from 'ui-patterns/AuthenticatedDropdownMenu'
|
|
import { useSetCommandMenuOpen } from 'ui-patterns/CommandMenu'
|
|
|
|
const useDropdownMenu = (user: User | null) => {
|
|
const router = useRouter()
|
|
const setCommandMenuOpen = useSetCommandMenuOpen()
|
|
|
|
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',
|
|
},
|
|
{
|
|
label: 'Command Menu',
|
|
icon: Command,
|
|
type: 'button',
|
|
onClick: () => setCommandMenuOpen(true),
|
|
shortcut: '⌘K',
|
|
},
|
|
],
|
|
[
|
|
{
|
|
label: 'Theme',
|
|
type: 'theme',
|
|
},
|
|
],
|
|
[
|
|
{
|
|
label: 'Sign out',
|
|
type: 'button',
|
|
icon: LogOut,
|
|
onClick: async () => {
|
|
await logOut()
|
|
router?.reload()
|
|
},
|
|
},
|
|
],
|
|
]
|
|
|
|
return menu
|
|
}
|
|
|
|
export default useDropdownMenu
|