mirror of
https://github.com/priyanshujain/margin.git
synced 2026-10-04 12:07:03 +00:00
feat(ui): back-to-library, export-only download button, save in book setup
This commit is contained in:
1 parent
686c7768c7
commit
e9669290ec
3 files changed
+30
-13
No files matched your search
@@ -2,17 +2,18 @@ import { useBook } from "../store/useBook";
|
||||
import { Icon } from "./Icon";
|
||||
|
||||
export function Sidebar() {
|
||||
const chapters = useBook((s) => s.book.chapters);
|
||||
const chapters = useBook((s) => s.book?.chapters ?? []);
|
||||
const activeChapterId = useBook((s) => s.activeChapterId);
|
||||
const setActiveChapter = useBook((s) => s.setActiveChapter);
|
||||
const addChapter = useBook((s) => s.addChapter);
|
||||
const closeBook = useBook((s) => s.closeBook);
|
||||
|
||||
return (
|
||||
<aside className="sidebar">
|
||||
<div className="brand">
|
||||
<button className="brand" onClick={closeBook} title="Back to library">
|
||||
<Icon d="M14 7l-5 5 5 5" size={15} />
|
||||
<span className="mark">margin</span>
|
||||
<span className="dot" />
|
||||
</div>
|
||||
</button>
|
||||
<div className="nav-label">Chapters</div>
|
||||
<ul className="chapters">
|
||||
{chapters.map((chapter, i) => (
|
||||
|
||||
Reference in new issue
Block a user