diff --git a/client/src/App.tsx b/client/src/App.tsx index 1d4e337..070fda1 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -44,6 +44,7 @@ import { useLiveQuery } from 'dexie-react-hooks' import { Ship, LogOut, ChevronLeft, Users, FileText, Settings, Wifi, WifiOff, Languages, BarChart2 } from 'lucide-react' import DisclaimerHeaderButton from './components/DisclaimerHeaderButton.tsx' import FeedbackHeaderButton from './components/FeedbackHeaderButton.tsx' +import ProfileHeaderButton from './components/ProfileHeaderButton.tsx' import { useTranslation } from 'react-i18next' import { cycleAppLanguage } from './utils/i18nLanguages.js' import { @@ -557,22 +558,27 @@ function App() { const isLogbookOwner = activeAccessRole === 'OWNER' || activeLogbookRecord?.isShared !== 1 + if (showUserProfile) { + return ( +
+ {pwaInstallBanner} + setShowUserProfile(false)} + onLogout={handleLogout} + /> +
+ ) + } + if (!activeLogbookId) { return (
{pwaInstallBanner} - {showUserProfile ? ( - setShowUserProfile(false)} - onLogout={handleLogout} - /> - ) : ( - setShowUserProfile(true)} - /> - )} + setShowUserProfile(true)} + />
) } @@ -622,6 +628,8 @@ function App() { + setShowUserProfile(true)} /> + void @@ -74,7 +75,6 @@ export default function LogbookDashboard({ onSelectLogbook, onLogout, onOpenProf const [sortDirection, setSortDirection] = useState('desc') const filterInputRef = useRef(null) const [online, setOnline] = useState(navigator.onLine) - const [username] = useState(localStorage.getItem('active_username') || 'Skipper') const { pendingCount, showSpinner, showPendingWarning, connStatusClassName } = useSyncIndicator() @@ -370,18 +370,7 @@ export default function LogbookDashboard({ onSelectLogbook, onLogout, onOpenProf )} - {/* Skipper profile */} - + {/* Lang toggle */} + ) +}