8aafdcfb16
Clicking the brand opens it, so the guide version and publication date are visible in the app rather than only on the PDF cover.
120 lines
3.0 KiB
TypeScript
120 lines
3.0 KiB
TypeScript
import type { ViewMode } from '../types';
|
|
|
|
interface Props {
|
|
view: ViewMode;
|
|
eventName: string;
|
|
photoCount: number;
|
|
selectedCount: number;
|
|
cloudLabel: string;
|
|
cloudOn: boolean;
|
|
/** Desktop mode has no account, so the team-server button is not shown. */
|
|
localMode?: boolean;
|
|
onViewChange: (view: ViewMode) => void;
|
|
onImport: () => void;
|
|
onExport: () => void;
|
|
onCloud: () => void;
|
|
onHelp: () => void;
|
|
onAbout: () => void;
|
|
onSearch: () => void;
|
|
onCatalog: () => void;
|
|
canShare: boolean;
|
|
onShare: () => void;
|
|
}
|
|
|
|
export default function TopBar({
|
|
view,
|
|
eventName,
|
|
photoCount,
|
|
selectedCount,
|
|
cloudLabel,
|
|
cloudOn,
|
|
localMode = false,
|
|
onViewChange,
|
|
onImport,
|
|
onExport,
|
|
onCloud,
|
|
onHelp,
|
|
onAbout,
|
|
onSearch,
|
|
onCatalog,
|
|
canShare,
|
|
onShare,
|
|
}: Props) {
|
|
return (
|
|
<header className="topbar">
|
|
<button
|
|
type="button"
|
|
className="brand brand-btn"
|
|
onClick={onAbout}
|
|
title="About Luminary"
|
|
aria-label="About Luminary"
|
|
>
|
|
<img className="brand-mark" src="/logo.png" alt="" height={20} />
|
|
Luminary
|
|
</button>
|
|
<button
|
|
type="button"
|
|
className="icon-btn mobile-only catalog-btn"
|
|
onClick={onCatalog}
|
|
title="Open catalog"
|
|
aria-label="Open catalog"
|
|
>
|
|
▤
|
|
</button>
|
|
|
|
<div className="topbar-title">
|
|
{eventName}
|
|
<span className="muted">
|
|
{' '}
|
|
· {photoCount} photo{photoCount === 1 ? '' : 's'}
|
|
{selectedCount > 1 ? ` · ${selectedCount} selected` : ''}
|
|
</span>
|
|
</div>
|
|
|
|
<nav className="module-bar">
|
|
<button className={view === 'grid' ? 'active' : ''} onClick={() => onViewChange('grid')}>
|
|
Library
|
|
</button>
|
|
<button className={view === 'develop' ? 'active' : ''} onClick={() => onViewChange('develop')}>
|
|
Develop
|
|
</button>
|
|
</nav>
|
|
|
|
<div className="topbar-actions">
|
|
{!localMode && (
|
|
<button className={`cloud-pill ${cloudOn ? 'on' : ''}`} onClick={onCloud} title="Team server">
|
|
<span className="cloud-dot" />
|
|
{cloudLabel}
|
|
</button>
|
|
)}
|
|
{canShare && (
|
|
<button className="btn ghost" onClick={onShare} title="Share this event for client proofing">
|
|
Share
|
|
</button>
|
|
)}
|
|
<button className="btn ghost" onClick={onExport}>
|
|
Export
|
|
</button>
|
|
<button className="icon-btn search-btn" onClick={onSearch} title="Search everything (⌘K / Ctrl+K)" aria-label="Search everything">
|
|
⌕
|
|
</button>
|
|
<button className="icon-btn help-btn" onClick={onHelp} title="Keyboard shortcuts (?)">
|
|
?
|
|
</button>
|
|
<a
|
|
className="guide-btn"
|
|
href="/luminary-user-guide.pdf"
|
|
target="_blank"
|
|
rel="noreferrer"
|
|
title="User guide (PDF)"
|
|
>
|
|
Guide
|
|
</a>
|
|
<button className="btn primary" onClick={onImport}>
|
|
Import photos
|
|
</button>
|
|
</div>
|
|
</header>
|
|
);
|
|
}
|