// Themed frame for pages outside a study project (Home, Import, Settings, Admin): // a calm app bar (brand, three destinations, account menu) and a page heading row. import { useEffect, useRef, useState } from 'react'; import { useApp } from '../../context/AppContext.js'; import { themeVars, READER_THEMES } from '../reader/readerThemes.js'; import { ChevronLeft, SearchIcon } from '../reader/icons.jsx'; // `short` is what a phone shows; the full label is still the button's accessible name. const NAV = [ { id: 'studies', label: 'Studies', short: 'Studies' }, { id: 'reader', label: 'Read Bible', short: 'Bible' }, { id: 'plans', label: 'Reading Plans', short: 'Plans' }, ]; // Avatar button with a dropdown: who you are, the theme, Settings, Admin, Log out. function AccountMenu() { const { authUser, readerTheme, setReaderTheme, setCurrentPage, logout } = useApp(); const [open, setOpen] = useState(false); const ref = useRef(null); useEffect(() => { if (!open) return undefined; const onDown = (e) => { if (!ref.current?.contains(e.target)) setOpen(false); }; const onKey = (e) => { if (e.key === 'Escape') setOpen(false); }; document.addEventListener('mousedown', onDown); document.addEventListener('keydown', onKey); return () => { document.removeEventListener('mousedown', onDown); document.removeEventListener('keydown', onKey); }; }, [open]); const go = (page) => { setOpen(false); setCurrentPage(page); }; const item = 'block w-full rounded-lg px-3 py-2 text-left text-sm hover:bg-black/5'; return (
{open && (
{authUser &&

{authUser.email}

}

Theme

{Object.entries(READER_THEMES).map(([id, t]) => ( ))}
{authUser && (
{authUser.isAdmin && }
)}
)}
); } export default function PageShell({ title, onBack, actions, active = null, maxWidth = 'max-w-6xl', children }) { const { readerTheme, goHome, goStudies, openBibleReader, openReadingPlans, openPalette } = useApp(); const go = { studies: goStudies, reader: openBibleReader, plans: openReadingPlans }; return (
Skip to content
{openPalette && ( )}
{onBack && ( )}

{title}

{actions &&
{actions}
}
{children}
); }