Hide account and team admin UI in single-user mode
The desktop bundle has one local admin and nothing to manage, so the account pill, the account panel and the team administration panel are left out when the server reports local mode.
This commit is contained in:
+8
-2
@@ -2221,6 +2221,11 @@ export default function App() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The Windows desktop bundle runs as one local admin (LUMINARY_LOCAL=1).
|
||||||
|
// Accounts and team administration have nothing to manage there, so both
|
||||||
|
// panels and the entry point to them stay out of the UI.
|
||||||
|
const localMode = cloudHealth?.local === true;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="app">
|
<div className="app">
|
||||||
<TopBar
|
<TopBar
|
||||||
@@ -2230,6 +2235,7 @@ export default function App() {
|
|||||||
selectedCount={selected.length}
|
selectedCount={selected.length}
|
||||||
cloudLabel={cloudUser ? cloudUser.name || cloudUser.email : cloudHealth ? 'Sign in' : 'Local only'}
|
cloudLabel={cloudUser ? cloudUser.name || cloudUser.email : cloudHealth ? 'Sign in' : 'Local only'}
|
||||||
cloudOn={!!cloudUser}
|
cloudOn={!!cloudUser}
|
||||||
|
localMode={localMode}
|
||||||
onViewChange={(v) => {
|
onViewChange={(v) => {
|
||||||
setCatalogOpen(false);
|
setCatalogOpen(false);
|
||||||
if (v === 'develop' && !activePhoto) {
|
if (v === 'develop' && !activePhoto) {
|
||||||
@@ -2646,7 +2652,7 @@ export default function App() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{cloudOpen && (
|
{cloudOpen && !localMode && (
|
||||||
<CloudPanel
|
<CloudPanel
|
||||||
health={cloudHealth}
|
health={cloudHealth}
|
||||||
user={cloudUser}
|
user={cloudUser}
|
||||||
@@ -2669,7 +2675,7 @@ export default function App() {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{adminOpen && cloudUser && (
|
{adminOpen && cloudUser && !localMode && (
|
||||||
<AdminPanel
|
<AdminPanel
|
||||||
user={cloudUser}
|
user={cloudUser}
|
||||||
onClose={() => setAdminOpen(false)}
|
onClose={() => setAdminOpen(false)}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ interface Props {
|
|||||||
selectedCount: number;
|
selectedCount: number;
|
||||||
cloudLabel: string;
|
cloudLabel: string;
|
||||||
cloudOn: boolean;
|
cloudOn: boolean;
|
||||||
|
/** Desktop mode has no account, so the team-server button is not shown. */
|
||||||
|
localMode?: boolean;
|
||||||
onViewChange: (view: ViewMode) => void;
|
onViewChange: (view: ViewMode) => void;
|
||||||
onImport: () => void;
|
onImport: () => void;
|
||||||
onExport: () => void;
|
onExport: () => void;
|
||||||
@@ -25,6 +27,7 @@ export default function TopBar({
|
|||||||
selectedCount,
|
selectedCount,
|
||||||
cloudLabel,
|
cloudLabel,
|
||||||
cloudOn,
|
cloudOn,
|
||||||
|
localMode = false,
|
||||||
onViewChange,
|
onViewChange,
|
||||||
onImport,
|
onImport,
|
||||||
onExport,
|
onExport,
|
||||||
@@ -70,10 +73,12 @@ export default function TopBar({
|
|||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div className="topbar-actions">
|
<div className="topbar-actions">
|
||||||
<button className={`cloud-pill ${cloudOn ? 'on' : ''}`} onClick={onCloud} title="Team server">
|
{!localMode && (
|
||||||
<span className="cloud-dot" />
|
<button className={`cloud-pill ${cloudOn ? 'on' : ''}`} onClick={onCloud} title="Team server">
|
||||||
{cloudLabel}
|
<span className="cloud-dot" />
|
||||||
</button>
|
{cloudLabel}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
{canShare && (
|
{canShare && (
|
||||||
<button className="btn ghost" onClick={onShare} title="Share this event for client proofing">
|
<button className="btn ghost" onClick={onShare} title="Share this event for client proofing">
|
||||||
Share
|
Share
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ export interface Health {
|
|||||||
version: string;
|
version: string;
|
||||||
needsSetup: boolean;
|
needsSetup: boolean;
|
||||||
registrationOpen: boolean;
|
registrationOpen: boolean;
|
||||||
|
/** Single-user desktop mode (LUMINARY_LOCAL=1): no accounts to manage. */
|
||||||
|
local?: boolean;
|
||||||
photos: number;
|
photos: number;
|
||||||
bytes: number;
|
bytes: number;
|
||||||
storage?: { root: string; custom: boolean };
|
storage?: { root: string; custom: boolean };
|
||||||
|
|||||||
Reference in New Issue
Block a user