Skip to content

Commit

Permalink
feat: add docs link to speed dial
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDuprey committed Feb 27, 2025
1 parent 1af58f9 commit dd1c132
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { createEmotionCache } from "../utils/create-emotion-cache";
import "../libs/nprogress";
import { PrivateRoute } from "../components/PrivateRoute";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import { useMediaPredicate } from "react-media-hook";
import Error500 from "./500";
import { ErrorBoundary } from "react-error-boundary";
Expand All @@ -25,10 +24,12 @@ import {
Help as HelpIcon,
BugReport as BugReportIcon,
Feedback as FeedbackIcon,
AutoStories,
} from "@mui/icons-material";
import { SvgIcon } from "@mui/material";
import discordIcon from "../../public/discord-mark-blue.svg";
import React from "react";
import { usePathname } from "next/navigation";
TimeAgo.addDefaultLocale(en);

const ReactQueryDevtoolsProduction = React.lazy(() =>
Expand All @@ -43,6 +44,7 @@ const App = (props) => {
const { Component, emotionCache = clientSideEmotionCache, pageProps } = props;
const getLayout = Component.getLayout ?? ((page) => page);
const preferredTheme = useMediaPredicate("(prefers-color-scheme: dark)") ? "dark" : "light";
const pathname = usePathname();

const speedDialActions = [
{
Expand All @@ -69,6 +71,13 @@ const App = (props) => {
href: "https://discord.gg/cyberdrain",
onClick: () => window.open("https://discord.gg/cyberdrain", "_blank")
},
{
id: "documentation",
icon: <AutoStories />,
name: "Check the Documentation",
href: `https://docs.cipp.app/user-documentation/${pathname}`,
onClick: () => window.open(`https://docs.cipp.app/user-documentation/${pathname}`, "_blank")
}
];

return (
Expand Down

0 comments on commit dd1c132

Please sign in to comment.