Added "home" button and tooltips
parent
f29f9315a1
commit
5c6a49d62a
|
@ -30,6 +30,8 @@ export function PageNavigator({
|
||||||
if (currentPage && currentPage.includes("/")) {
|
if (currentPage && currentPage.includes("/")) {
|
||||||
const pieces = currentPage.split("/");
|
const pieces = currentPage.split("/");
|
||||||
completePrefix = pieces.slice(0, pieces.length - 1).join("/") + "/";
|
completePrefix = pieces.slice(0, pieces.length - 1).join("/") + "/";
|
||||||
|
} else if (currentPage && currentPage.includes(" ")) {
|
||||||
|
completePrefix = currentPage.split(" ")[0] + " ";
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<FilterList
|
<FilterList
|
||||||
|
|
|
@ -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 { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { Notification } from "../types";
|
import { Notification } from "../types";
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ export function TopBar({
|
||||||
unsavedChanges,
|
unsavedChanges,
|
||||||
notifications,
|
notifications,
|
||||||
onClick,
|
onClick,
|
||||||
|
onHomeClick,
|
||||||
onActionClick,
|
onActionClick,
|
||||||
lhs,
|
lhs,
|
||||||
rhs,
|
rhs,
|
||||||
|
@ -22,6 +23,7 @@ export function TopBar({
|
||||||
unsavedChanges: boolean;
|
unsavedChanges: boolean;
|
||||||
notifications: Notification[];
|
notifications: Notification[];
|
||||||
onClick: () => void;
|
onClick: () => void;
|
||||||
|
onHomeClick: () => void;
|
||||||
onActionClick: () => void;
|
onActionClick: () => void;
|
||||||
lhs?: React.ReactNode;
|
lhs?: React.ReactNode;
|
||||||
rhs?: React.ReactNode;
|
rhs?: React.ReactNode;
|
||||||
|
@ -46,10 +48,19 @@ export function TopBar({
|
||||||
<div className="actions">
|
<div className="actions">
|
||||||
<button
|
<button
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
// setMenuExpanded(!menuExpanded);
|
onHomeClick();
|
||||||
|
e.stopPropagation();
|
||||||
|
}}
|
||||||
|
title="Navigate to the 'index' page"
|
||||||
|
>
|
||||||
|
<FontAwesomeIcon icon={faHome} />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={(e) => {
|
||||||
onActionClick();
|
onActionClick();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}}
|
}}
|
||||||
|
title="Open the command palette"
|
||||||
>
|
>
|
||||||
<FontAwesomeIcon icon={faRunning} />
|
<FontAwesomeIcon icon={faRunning} />
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -656,6 +656,9 @@ export class Editor {
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
dispatch({ type: "start-navigate" });
|
dispatch({ type: "start-navigate" });
|
||||||
}}
|
}}
|
||||||
|
onHomeClick={() => {
|
||||||
|
editor.navigate("index");
|
||||||
|
}}
|
||||||
onActionClick={() => {
|
onActionClick={() => {
|
||||||
dispatch({ type: "show-palette" });
|
dispatch({ type: "show-palette" });
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -112,35 +112,13 @@ body {
|
||||||
}
|
}
|
||||||
.actions {
|
.actions {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
width: 40px;
|
|
||||||
|
|
||||||
ul {
|
button {
|
||||||
list-style: none;
|
border: 1px solid #7897d0;
|
||||||
margin-left: 0;
|
border-radius: 3px;
|
||||||
padding-left: 0;
|
margin: 3px;
|
||||||
margin-top: 0;
|
padding: 5px;
|
||||||
list-style: none;
|
background-color: #e6e6e6;
|
||||||
background: #fff;
|
|
||||||
border: #000 1px solid;
|
|
||||||
text-align: left;
|
|
||||||
|
|
||||||
a {
|
|
||||||
padding: 3px;
|
|
||||||
font-family: var(--ui-font);
|
|
||||||
font-size: 50%;
|
|
||||||
text-decoration: none;
|
|
||||||
color: #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
li {
|
|
||||||
padding-left: 10px;
|
|
||||||
padding-right: 10px;
|
|
||||||
padding-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
li:hover {
|
|
||||||
background-color: #4d8dff12;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue