X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/c324b64f3b26e79b4640b6f0cf55671f1a261bca..b6ac7fe88d347582d39fffa002e300af222c578f:/src/views-components/main-app-bar/help-menu.tsx

diff --git a/src/views-components/main-app-bar/help-menu.tsx b/src/views-components/main-app-bar/help-menu.tsx
index 26604228..af76e4f1 100644
--- a/src/views-components/main-app-bar/help-menu.tsx
+++ b/src/views-components/main-app-bar/help-menu.tsx
@@ -2,12 +2,15 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from "react";
-import { MenuItem, Typography, ListSubheader } from "@material-ui/core";
-import { DropdownMenu } from "~/components/dropdown-menu/dropdown-menu";
-import { ImportContactsIcon, HelpIcon } from "~/components/icon/icon";
-import { ArvadosTheme } from '~/common/custom-theme';
+import React from "react";
+import { MenuItem, Typography } from "@material-ui/core";
+import { DropdownMenu } from "components/dropdown-menu/dropdown-menu";
+import { ImportContactsIcon, HelpIcon } from "components/icon/icon";
+import { ArvadosTheme } from 'common/custom-theme';
 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
+import { RootState } from "store/store";
+import { compose } from "redux";
+import { connect } from "react-redux";
 
 type CssRules = 'link' | 'icon' | 'title' | 'linkTitle';
 
@@ -34,10 +37,6 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 });
 
 const links = [
-    {
-        title: "Public Pipelines and Data sets",
-        link: "https://dev.arvados.org/projects/arvados/wiki/Public_Pipelines_and_Datasets",
-    },
     {
         title: "Tutorials and User guide",
         link: "http://doc.arvados.org/user/",
@@ -52,22 +51,33 @@ const links = [
     },
 ];
 
-export const HelpMenu = withStyles(styles)(
-    ({ classes }: WithStyles<CssRules>) =>
-        <DropdownMenu
-            icon={<HelpIcon />}
-            id="help-menu"
-            title="Help">
-            <MenuItem disabled>Help</MenuItem>
-            {
-                links.map(link =>
-                    <MenuItem key={link.title}>
-                        <a href={link.link} target="_blank" className={classes.link}>
-                            <ImportContactsIcon className={classes.icon} />
-                            <Typography variant="body1" className={classes.linkTitle}>{link.title}</Typography>
-                        </a>
-                    </MenuItem>
-                )
-            }
-        </DropdownMenu>
-);
+interface HelpMenuProps {
+    currentRoute: string;
+}
+
+const mapStateToProps = ({ router }: RootState) => ({
+    currentRoute: router.location ? router.location.pathname : '',
+});
+
+export const HelpMenu = compose(
+    connect(mapStateToProps),
+    withStyles(styles))(
+        ({ classes, currentRoute }: HelpMenuProps & WithStyles<CssRules>) =>
+            <DropdownMenu
+                icon={<HelpIcon />}
+                id="help-menu"
+                title="Help"
+                key={currentRoute}>
+                <MenuItem disabled>Help</MenuItem>
+                {
+                    links.map(link =>
+                        <MenuItem key={link.title}>
+                            <a href={link.link} target="_blank" rel="noopener noreferrer" className={classes.link}>
+                                <ImportContactsIcon className={classes.icon} />
+                                <Typography className={classes.linkTitle}>{link.title}</Typography>
+                            </a>
+                        </MenuItem>
+                    )
+                }
+            </DropdownMenu>
+    );
