diff --git a/Client/src/Components/Sidebar/index.jsx b/Client/src/Components/Sidebar/index.jsx index bb2097944..be7689235 100644 --- a/Client/src/Components/Sidebar/index.jsx +++ b/Client/src/Components/Sidebar/index.jsx @@ -71,12 +71,18 @@ const menu = [ ]; const other = [ - { name: "Support", path: "support", icon: }, { name: "Settings", path: "settings", icon: }, + { name: "Support", path: "support", icon: }, { name: "Docs", path: "docs", icon: }, { name: "Changelog", path: "changelog", icon: }, ]; +const URL_MAP = { + support: "https://github.com/bluewave-labs/bluewave-uptime/issues", + docs: "https://bluewavelabs.gitbook.io/uptime-manager", + changelog: "https://github.com/bluewave-labs/bluewave-uptime/releases", +}; + /** * @component * Sidebar component serves as a sidebar containing a menu. @@ -502,34 +508,14 @@ function Sidebar() { className={ location.pathname.includes(item.path) ? "selected-path" : "" } - onClick={ - () => { - if (item.path === "support") { - window.open( - "https://github.com/bluewave-labs/bluewave-uptime/issues", - "_blank", - "noreferrer" - ); - } - else if(item.path === "docs"){ - window.open( - "https://bluewavelabs.gitbook.io/uptime-manager", - "_blank", - "noreferrer" - ) - } - else if(item.path === "changelog"){ - window.open( - "https://github.com/bluewave-labs/bluewave-uptime/releases", - "_blank", - "noreferrer" - ) - } - else{ - navigate(`/${item.path}`) - } + onClick={() => { + const url = URL_MAP[item.path]; + if (url) { + window.open(url, "_blank", "noreferrer"); + } else { + navigate(`/${item.path}`); } - } + }} sx={{ gap: theme.spacing(4), borderRadius: theme.shape.borderRadius,