Admin view in the web UI
This commit is contained in:
+7
-3
@@ -1,12 +1,16 @@
|
||||
import { h, replace } from "./dom.js";
|
||||
import type { View } from "./panes.js";
|
||||
import { activeTasks, findTask, onEach, state } from "./state.js";
|
||||
|
||||
export function mountNavbar(root: HTMLElement, showInbox: () => void): void {
|
||||
export function mountNavbar(root: HTMLElement, show: (view: View) => void): void {
|
||||
const crumb = h("button", { class: "crumb", title: "Switch task (⌘K)" });
|
||||
crumb.onclick = openSwitcher;
|
||||
|
||||
const inbox = h("button", { class: "inbox-count" });
|
||||
inbox.onclick = showInbox;
|
||||
inbox.onclick = () => show("inbox");
|
||||
|
||||
const admin = h("button", { class: "nav-link" }, "Admin");
|
||||
admin.onclick = () => show("admin");
|
||||
|
||||
const conn = h("span", { class: "connection down", title: "connecting" });
|
||||
const me = h("span", { class: "me" });
|
||||
@@ -26,7 +30,7 @@ export function mountNavbar(root: HTMLElement, showInbox: () => void): void {
|
||||
};
|
||||
|
||||
onEach(["me", "projects", "tasks", "inbox", "selection", "connection"], render);
|
||||
replace(root, h("a", { href: "#/", class: "brand" }, "byre"), crumb, h("span", { class: "spacer" }), inbox, conn, me);
|
||||
replace(root, h("a", { href: "#/", class: "brand" }, "byre"), crumb, h("span", { class: "spacer" }), inbox, admin, conn, me);
|
||||
render();
|
||||
|
||||
addEventListener("keydown", (e) => {
|
||||
|
||||
Reference in New Issue
Block a user