1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from "react";
6 import { MenuItem, Typography } from "@material-ui/core";
7 import { DropdownMenu } from "~/components/dropdown-menu/dropdown-menu";
8 import { ImportContactsIcon, HelpIcon } from "~/components/icon/icon";
9 import { ArvadosTheme } from '~/common/custom-theme';
10 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
11 import { RootState } from "~/store/store";
12 import { compose } from "redux";
13 import { connect } from "react-redux";
15 type CssRules = 'link' | 'icon' | 'title' | 'linkTitle';
17 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
19 textDecoration: 'none',
29 paddingBottom: theme.spacing.unit * 0.5,
30 paddingLeft: theme.spacing.unit * 2,
31 paddingTop: theme.spacing.unit * 0.5,
35 marginLeft: theme.spacing.unit
41 title: "Public Pipelines and Data sets",
42 link: "https://dev.arvados.org/projects/arvados/wiki/Public_Pipelines_and_Datasets",
45 title: "Tutorials and User guide",
46 link: "http://doc.arvados.org/user/",
49 title: "API Reference",
50 link: "http://doc.arvados.org/api/",
53 title: "SDK Reference",
54 link: "http://doc.arvados.org/sdk/"
58 interface HelpMenuProps {
62 const mapStateToProps = ({ router }: RootState) => ({
63 currentRoute: router.location ? router.location.pathname : '',
66 export const HelpMenu = compose(
67 connect(mapStateToProps),
69 ({ classes, currentRoute }: HelpMenuProps & WithStyles<CssRules>) =>
75 <MenuItem disabled>Help</MenuItem>
78 <MenuItem key={link.title}>
79 <a href={link.link} target="_blank" className={classes.link}>
80 <ImportContactsIcon className={classes.icon} />
81 <Typography className={classes.linkTitle}>{link.title}</Typography>