1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
7 import { ArvadosTheme } from '~/common/custom-theme';
8 import { SidePanelTree, SidePanelTreeProps } from '~/views-components/side-panel-tree/side-panel-tree';
9 import { compose, Dispatch } from 'redux';
10 import { connect } from 'react-redux';
11 import { navigateFromSidePanel } from '../../store/side-panel/side-panel-action';
12 import { Grid } from '@material-ui/core';
13 import { SidePanelButton } from '~/views-components/side-panel-button/side-panel-button';
15 const DRAWER_WITDH = 240;
17 type CssRules = 'root';
19 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
21 background: theme.palette.background.paper,
22 borderRight: `1px solid ${theme.palette.divider}`,
29 const mapDispatchToProps = (dispatch: Dispatch): SidePanelTreeProps => ({
30 onItemActivation: id => {
31 dispatch<any>(navigateFromSidePanel(id));
35 export const SidePanel = compose(
37 connect(undefined, mapDispatchToProps)
38 )(({ classes, ...props }: WithStyles<CssRules> & SidePanelTreeProps) =>
41 <SidePanelTree {...props} />