X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/35694e6fc2214c366f09ddd75c9910d91cd3ed20..f6093a73debdd7135870582088202da459386f17:/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 2c56c85e..350f9aa6 100644
--- a/src/views-components/main-app-bar/help-menu.tsx
+++ b/src/views-components/main-app-bar/help-menu.tsx
@@ -8,14 +8,18 @@ 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' | 'linkContent';
+type CssRules = 'link' | 'icon' | 'title' | 'linkTitle';
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     link: {
         textDecoration: 'none',
         color: 'inherit',
         width: '100%',
+        display: 'flex'
     },
     icon: {
         width: '16px',
@@ -30,16 +34,9 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     linkTitle: {
         marginLeft: theme.spacing.unit
     },
-    linkContent: {
-        display: 'flex'
-    }
 });
 
 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/",
@@ -54,26 +51,33 @@ const links = [
     },
 ];
 
-export const HelpMenu = withStyles(styles)(
-    ({ classes }: WithStyles<CssRules>) =>
-        <DropdownMenu
-            icon={<HelpIcon />}
-            id="help-menu"
-            title="Help">
-            <li className={classes.title}>
-                <Typography variant="body1">Help</Typography>
-            </li>
-            {
-                links.map(link =>
-                    <MenuItem key={link.title}>
-                        <a href={link.link} target="_blank" className={classes.link}>
-                            <div className={classes.linkContent}>
+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" className={classes.link}>
                                 <ImportContactsIcon className={classes.icon} />
-                                <Typography variant="body1" className={classes.linkTitle}>{link.title}</Typography>
-                            </div>
-                        </a>
-                    </MenuItem>
-                )
-            }
-        </DropdownMenu>
-);
+                                <Typography className={classes.linkTitle}>{link.title}</Typography>
+                            </a>
+                        </MenuItem>
+                    )
+                }
+            </DropdownMenu>
+    );
