This commit is contained in:
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react';
|
||||
import type { PageId } from '../../lib/urlState';
|
||||
import type { AuthUser } from '../../App';
|
||||
import { ThemeToggle } from './ThemeToggle';
|
||||
import { ChangePasswordDialog } from '../admin/LocalUserDialogs';
|
||||
|
||||
interface TopBarProps {
|
||||
currentPage: PageId;
|
||||
@@ -74,6 +75,7 @@ export function TopBar({
|
||||
}: TopBarProps) {
|
||||
const visibleNav = visibleNavItemsFor(isAdmin, authEnabled);
|
||||
const compactMode = useViewportNarrow(estimateCollapseThreshold(visibleNav.length));
|
||||
const [showPwChange, setShowPwChange] = useState(false);
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -170,6 +172,13 @@ export function TopBar({
|
||||
{user.name ?? user.email}
|
||||
</span>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowPwChange(true)}
|
||||
className="px-2 py-1 rounded-md text-2xs text-slate-500 hover:text-slate-800 hover:bg-surface transition-colors"
|
||||
>
|
||||
パスワード変更
|
||||
</button>
|
||||
<a
|
||||
href="/auth/logout"
|
||||
className="px-2 py-1 rounded-md text-2xs text-slate-500 hover:text-slate-800 hover:bg-surface transition-colors"
|
||||
@@ -178,6 +187,7 @@ export function TopBar({
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
{showPwChange && <ChangePasswordDialog onClose={() => setShowPwChange(false)} />}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user