1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import 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: "Tutorials and User guide",
42 link: "http://doc.arvados.org/user/",
45 title: "API Reference",
46 link: "http://doc.arvados.org/api/",
49 title: "SDK Reference",
50 link: "http://doc.arvados.org/sdk/"
54 interface HelpMenuProps {
58 const mapStateToProps = ({ router }: RootState) => ({
59 currentRoute: router.location ? router.location.pathname : '',
62 export const HelpMenu = compose(
63 connect(mapStateToProps),
65 ({ classes, currentRoute }: HelpMenuProps & WithStyles<CssRules>) =>
71 <MenuItem disabled>Help</MenuItem>
74 <MenuItem key={link.title}>
75 <a href={link.link} target="_blank" rel="noopener" className={classes.link}>
76 <ImportContactsIcon className={classes.icon} />
77 <Typography className={classes.linkTitle}>{link.title}</Typography>