diff --git a/src/components/BookCover.jsx b/src/components/BookCover.jsx index 9188dd4..36283ba 100644 --- a/src/components/BookCover.jsx +++ b/src/components/BookCover.jsx @@ -1,13 +1,13 @@ // The picture on a study's card: a coloured cover for the kind of book, with the book's name. import { coverFor } from '../utils/bookCovers.js'; -export default function BookCover({ summary, className = '' }) { +export default function BookCover({ summary, className = '', compact = false }) { const { group, name, extra } = coverFor(summary); const [from, to] = group.colors; const id = `cover-${group.id}`; return (
-
); diff --git a/src/pages/HomePage.jsx b/src/pages/HomePage.jsx index 6a63db8..55906ed 100644 --- a/src/pages/HomePage.jsx +++ b/src/pages/HomePage.jsx @@ -51,6 +51,12 @@ export default function HomePage() { try { return localStorage.getItem('homeSort') || 'recent'; } catch { return 'recent'; } }); // 'recent' | 'title' | 'passage' const [homeTagFilter, setHomeTagFilter] = useState(''); + const [homeView, setHomeView] = useState(() => { + try { return localStorage.getItem('homeView') === 'list' ? 'list' : 'grid'; } catch { return 'grid'; } + }); // 'grid' | 'list' + useEffect(() => { + try { localStorage.setItem('homeView', homeView); } catch {} + }, [homeView]); const [homeFullTextResults, setHomeFullTextResults] = useState(null); // null=idle, []=no match, [...]= results const fullTextTimerRef = useRef(null); const [renamingId, setRenamingId] = useState(null); @@ -163,6 +169,12 @@ export default function HomePage() { +
+ {[['grid', 'Grid'], ['list', 'List']].map(([id, label]) => ( + + ))} +
{allTags.length > 0 && (