From 063a8e4767dcf0f7c0d352b6a3b29188f08cbffe Mon Sep 17 00:00:00 2001 From: JordanPaoletti Date: Sat, 10 Jun 2023 08:15:16 -0600 Subject: [PATCH] allow top bar action buttons to be links and make home one (#417) --- .gitignore | 3 ++- web/components/top_bar.tsx | 27 ++++++++++++++++----------- web/editor.tsx | 1 + 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index f5c88587..9bfda026 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ website_build .idea deno.lock fly.toml -env.sh \ No newline at end of file +env.sh +test_space \ No newline at end of file diff --git a/web/components/top_bar.tsx b/web/components/top_bar.tsx index 0028d476..f38a9e36 100644 --- a/web/components/top_bar.tsx +++ b/web/components/top_bar.tsx @@ -13,6 +13,7 @@ export type ActionButton = { icon: FunctionalComponent; description: string; callback: () => void; + href?: string; }; export function TopBar({ @@ -118,17 +119,21 @@ export function TopBar({ )}
- {actionButtons.map((actionButton) => ( - - ))} + {actionButtons.map((actionButton) => { + const button = + + + return actionButton.href !== undefined ? ({button}) : button; + })}
diff --git a/web/editor.tsx b/web/editor.tsx index 9acbd9a9..8677c33c 100644 --- a/web/editor.tsx +++ b/web/editor.tsx @@ -1405,6 +1405,7 @@ export class Editor { callback: () => { editor.navigate(""); }, + href: "", }, { icon: BookIcon,