From 2856d1b4e92f46fe9707f75f4e18e4294e244328 Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Thu, 28 Nov 2024 02:36:45 +0000 Subject: [PATCH] more --- .../Sidebar/SidebarTabs/index.tsx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/components/CentralContainer/Sidebar/SidebarTabs/index.tsx b/src/components/CentralContainer/Sidebar/SidebarTabs/index.tsx index 90b3c93e..ea512217 100644 --- a/src/components/CentralContainer/Sidebar/SidebarTabs/index.tsx +++ b/src/components/CentralContainer/Sidebar/SidebarTabs/index.tsx @@ -1,6 +1,6 @@ import { forwardRef, - useContext, + useState, } from "react"; import { @@ -9,11 +9,11 @@ import { } from "@mui/joy"; import SvgIcon from "@mui/material/SvgIcon"; +import HelpOutlineIcon from "@mui/icons-material/HelpOutline"; import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined"; import SearchIcon from "@mui/icons-material/Search"; import SettingsOutlinedIcon from "@mui/icons-material/SettingsOutlined"; -import {StateContext} from "../../../../contexts/StateContextProvider"; import {TAB_NAME} from "../../../../typings/tab"; import SettingsModal from "../../../modals/SettingsModal"; import FileInfoTabPanel from "./FileInfoTabPanel"; @@ -23,6 +23,8 @@ import TabButton from "./TabButton"; import "./index.css"; +const DOCUMENTATION_URL = "https://docs.yscope.com/yscope-log-viewer/main/user-guide/index.html"; + /** * Lists information for each tab. */ @@ -52,7 +54,7 @@ const SidebarTabs = forwardRef(( }, tabListRef ) => { - const {isSettingsModalOpen, setIsSettingsModalOpen} = useContext(StateContext); + const [isSettingsModalOpen, setIsSettingsModalOpen] = useState(false); const handleSettingsModalClose = () => { setIsSettingsModalOpen(false); @@ -63,6 +65,9 @@ const SidebarTabs = forwardRef(( case TAB_NAME.SETTINGS: setIsSettingsModalOpen(true); break; + case TAB_NAME.DOCUMENTATION: + window.open(DOCUMENTATION_URL, "_blank"); + break; default: onActiveTabNameChange(tabName); } @@ -88,9 +93,14 @@ const SidebarTabs = forwardRef(( onTabButtonClick={handleTabButtonClick}/> ))} - {/* Forces the settings tab to bottom of sidebar. */} + {/* Forces the settings and help tab to bottom of sidebar. */}
+ +