Skip to content

Commit

Permalink
Add user guide links
Browse files Browse the repository at this point in the history
  • Loading branch information
underbluewaters committed Feb 5, 2025
1 parent a1e3941 commit 02f80b6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
18 changes: 17 additions & 1 deletion packages/client/src/admin/AdminApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { GraphqlQueryCacheContext } from "../offline/GraphqlQueryCache/useGraphq
import LanguageSelector from "../surveys/LanguageSelector";
import TranslateIcon from "@heroicons/react/outline/TranslateIcon";
import { useLocalStorage } from "beautiful-react-hooks";
import { BookOpenIcon } from "@heroicons/react/outline";

const LazyBasicSettings = React.lazy(
/* webpackChunkName: "AdminSettings" */ () => import("./Settings")
Expand Down Expand Up @@ -302,6 +303,11 @@ export default function AdminApp() {
},
]
: []),
{
breadcrumb: "Administrator Guide",
icon: <BookOpenIcon className={iconClassName} />,
path: "https://docs.seasketch.org/seasketch-documentation",
},
];
const [mobileSidebarOpen, setMobileSidebarOpen] = useState(false);
const [mobileHeaderState, setMobileHeaderState] =
Expand Down Expand Up @@ -506,7 +512,17 @@ function SidebarContents(props: {
<NavLink
exact={section.path === "/admin"}
key={section.path}
onClick={section.new ? () => setNewDismissed(true) : undefined}
onClick={(e) => {
if (section.new) {
setNewDismissed(true);
} else if (/http.*:\/\//.test(section.path)) {
window.open(section.path, "_blank");
e.preventDefault();
e.stopPropagation();
} else {
return;
}
}}
to={`/${props.slug}${section.path}`}
activeClassName="bg-primary-600 text-white"
className="group flex items-center px-2 py-2 md:text-sm leading-5 font-medium text-indigo-100 rounded-md hover:text-white hover:bg-primary-600 focus:outline-none focus:text-white focus:bg-primary-600 transition ease-in-out duration-75"
Expand Down
12 changes: 12 additions & 0 deletions packages/client/src/projects/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
SignInButton,
SignOutButton,
EditProfileButton,
HelpButton,
} from "./ToolbarButtons";
import { Link, useHistory, useParams, useRouteMatch } from "react-router-dom";
import { MenuToggle } from "./MenuToggle";
Expand Down Expand Up @@ -332,6 +333,17 @@ export default function Toolbar({
</>
)}

<HelpButton
tooltip={t("User Guide")}
onClick={() =>
window.open(
"https://docs.seasketch.org/seasketch-documentation/users-guide/getting-started",
"_blank"
)
}
expanded={expanded}
/>

<LanguageSelector
button={(onClick, lang) => (
<LanguageButton
Expand Down
11 changes: 9 additions & 2 deletions packages/client/src/projects/ToolbarButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { QuestionMarkCircledIcon } from "@radix-ui/react-icons";
import { ProfileStatusButton } from "../header/ProfileStatusButton";
import clsx from "clsx";
import * as Tooltip from "@radix-ui/react-tooltip";
import { BookOpenIcon } from "@heroicons/react/outline";

interface SidebarButtonProps {
className?: string;
Expand Down Expand Up @@ -231,10 +232,10 @@ export const SignInButton = curry(

export const SignOutButton = curry(
<svg
className="left-0.5 relative"
className="relative"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
viewBox="-1 0 25 25"
stroke="currentColor"
>
<path
Expand Down Expand Up @@ -335,6 +336,12 @@ export const SettingsIcon = (
);
export const SettingsButton = curry(SettingsIcon);

export const HelpIcon = (
<BookOpenIcon className="w-6 h-6 inline-block mt-[1px]" />
);

export const HelpButton = curry(HelpIcon);

export const LanguageIcon = (
<TranslateIcon style={{ marginLeft: 1 }} className="w-7 h-7 inline-block " />
);
Expand Down

0 comments on commit 02f80b6

Please sign in to comment.