Added "home" button and tooltips

This commit is contained in:
Zef Hemel
2022-07-04 11:38:16 +02:00
parent f29f9315a1
commit 5c6a49d62a
4 changed files with 24 additions and 30 deletions
@@ -30,6 +30,8 @@ export function PageNavigator({
if (currentPage && currentPage.includes("/")) {
const pieces = currentPage.split("/");
completePrefix = pieces.slice(0, pieces.length - 1).join("/") + "/";
} else if (currentPage && currentPage.includes(" ")) {
completePrefix = currentPage.split(" ")[0] + " ";
}
return (
<FilterList
+13 -2
View File
@@ -1,4 +1,4 @@
import { faRunning } from "@fortawesome/free-solid-svg-icons";
import { faRunning, faHome } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Notification } from "../types";
@@ -14,6 +14,7 @@ export function TopBar({
unsavedChanges,
notifications,
onClick,
onHomeClick,
onActionClick,
lhs,
rhs,
@@ -22,6 +23,7 @@ export function TopBar({
unsavedChanges: boolean;
notifications: Notification[];
onClick: () => void;
onHomeClick: () => void;
onActionClick: () => void;
lhs?: React.ReactNode;
rhs?: React.ReactNode;
@@ -46,10 +48,19 @@ export function TopBar({
<div className="actions">
<button
onClick={(e) => {
// setMenuExpanded(!menuExpanded);
onHomeClick();
e.stopPropagation();
}}
title="Navigate to the 'index' page"
>
<FontAwesomeIcon icon={faHome} />
</button>
<button
onClick={(e) => {
onActionClick();
e.stopPropagation();
}}
title="Open the command palette"
>
<FontAwesomeIcon icon={faRunning} />
</button>