Feature #13704
Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki@contractors.roche.com>
import Tabs from '@material-ui/core/Tabs';
import Tab from '@material-ui/core/Tab';
import Typography from '@material-ui/core/Typography';
import Tabs from '@material-ui/core/Tabs';
import Tab from '@material-ui/core/Tab';
import Typography from '@material-ui/core/Typography';
-import * as classnames from "classnames";
import Grid from '@material-ui/core/Grid';
import Grid from '@material-ui/core/Grid';
-
-function TabContainer(props: any) {
- return (
- <Typography component="div" style={{ padding: 8 * 3 }}>
- {props.children}
- </Typography>
- );
-}
+import * as classnames from "classnames";
export interface DetailsPanelProps {
export interface DetailsPanelProps {
- toggleDrawer: (isOpened: boolean) => void;
+ closeDrawer: () => void;
handleChange = (event: any, value: boolean) => {
this.setState({ tabsValue: value });
}
handleChange = (event: any, value: boolean) => {
this.setState({ tabsValue: value });
}
+
+ renderTabContainer = (children: React.ReactElement<any>) => {
+ return (
+ <Typography className={this.props.classes.tabContainer} component="div">
+ {children}
+ </Typography>
+ );
+ }
+
- const { classes, toggleDrawer, isOpened } = this.props;
+ const { classes, closeDrawer, isOpened } = this.props;
const { tabsValue } = this.state;
return (
<div className={classnames([classes.container, { [classes.opened]: isOpened }])}>
const { tabsValue } = this.state;
return (
<div className={classnames([classes.container, { [classes.opened]: isOpened }])}>
- <Drawer variant="persistent" anchor="right" open={isOpened} onClose={() => toggleDrawer(false)}
- classes={{
- paper: classes.drawerPaper
- }}>
- {/* className={classnames([classes.root, { [classes.active]: isActive }])} */}
+ <Drawer variant="permanent" anchor="right" classes={{ paper: classes.drawerPaper }}>
<Typography component="div" className={classes.headerContainer}>
<Grid container alignItems='center' justify='space-around'>
<Typography variant="title">
Tutorial pipeline
</Typography>
<Typography component="div" className={classes.headerContainer}>
<Grid container alignItems='center' justify='space-around'>
<Typography variant="title">
Tutorial pipeline
</Typography>
- <IconButton color="inherit" onClick={() => toggleDrawer(false)}>
+ <IconButton color="inherit" onClick={closeDrawer}>
<CloseIcon />
</IconButton>
</Grid>
<CloseIcon />
</IconButton>
</Grid>
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
label="Activity" />
</Tabs>
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
label="Activity" />
</Tabs>
- {tabsValue === 0 && <TabContainer>
+ {tabsValue === 0 && this.renderTabContainer(
<Grid container>
<Grid item xs={6} sm={4} className={classes.gridLabel}>
<p>Type</p>
<Grid container>
<Grid item xs={6} sm={4} className={classes.gridLabel}>
<p>Type</p>
<p>me</p>
</Grid>
</Grid>
<p>me</p>
</Grid>
</Grid>
- </TabContainer>}
- {tabsValue === 1 && <TabContainer>
+ )}
+ {tabsValue === 1 && this.renderTabContainer(
<Grid container>
<Grid item xs={6} sm={4} className={classes.gridLabel}>
<p>Type</p>
<Grid container>
<Grid item xs={6} sm={4} className={classes.gridLabel}>
<p>Type</p>
<p>me</p>
</Grid>
</Grid>
<p>me</p>
</Grid>
</Grid>
| 'tabsIndicator' | 'tabRoot' | 'tabContainer' | 'tabSelected' | 'gridLabel';
const drawerWidth = 320;
| 'tabsIndicator' | 'tabRoot' | 'tabContainer' | 'tabSelected' | 'gridLabel';
const drawerWidth = 320;
-const purple = '#692498';
+const colorPurple = '#692498';
+const colorLightGray = '#A1A1A1';
+const colorVeryLightGray = '#999999';
+const colorGray = '#333';
+
const styles: StyleRulesCallback<CssRules> = (theme: Theme) => ({
container: {
width: 0,
const styles: StyleRulesCallback<CssRules> = (theme: Theme) => ({
container: {
width: 0,
width: drawerWidth
},
headerContainer: {
width: drawerWidth
},
headerContainer: {
margin: `${theme.spacing.unit}px 0`
},
tabsIndicator: {
margin: `${theme.spacing.unit}px 0`
},
tabsIndicator: {
- backgroundColor: purple
+ backgroundColor: colorPurple
'&$tabSelected': {
fontWeight: 700,
'&$tabSelected': {
fontWeight: 700,
},
tabSelected: {},
gridLabel: {
},
tabSelected: {},
gridLabel: {
+ color: colorVeryLightGray,
onSearch: (searchText: string) => void;
onBreadcrumbClick: (breadcrumb: Breadcrumb) => void;
onMenuItemClick: (menuItem: MainAppBarMenuItem) => void;
onSearch: (searchText: string) => void;
onBreadcrumbClick: (breadcrumb: Breadcrumb) => void;
onMenuItemClick: (menuItem: MainAppBarMenuItem) => void;
- onDetailsPanelClick: (isOpened: boolean) => void;
+ onDetailsPanelToggle: () => void;
}
type MainAppBarProps = MainAppBarDataProps & MainAppBarActionProps & WithStyles<CssRules>;
}
type MainAppBarProps = MainAppBarDataProps & MainAppBarActionProps & WithStyles<CssRules>;
{
props.user && <Breadcrumbs items={props.breadcrumbs} onClick={props.onBreadcrumbClick} />
}
{
props.user && <Breadcrumbs items={props.breadcrumbs} onClick={props.onBreadcrumbClick} />
}
- <IconButton color="inherit" onClick={() => props.onDetailsPanelClick(true)}>
+ <IconButton color="inherit" onClick={props.onDetailsPanelToggle}>
<InfoIcon />
</IconButton>
</Toolbar>
<InfoIcon />
</IconButton>
</Toolbar>
this.props.dispatch(push(`/search?q=${searchText}`));
},
onMenuItemClick: (menuItem: NavMenuItem) => menuItem.action(),
this.props.dispatch(push(`/search?q=${searchText}`));
},
onMenuItemClick: (menuItem: NavMenuItem) => menuItem.action(),
- onDetailsPanelClick: (isOpened: boolean) => {
- this.setState({ isDetailsPanelOpened: isOpened });
+ onDetailsPanelToggle: () => {
+ this.setState(prev => ({ isDetailsPanelOpened: !prev.isDetailsPanelOpened }));
</div>
<DetailsPanel
isOpened={this.state.isDetailsPanelOpened}
</div>
<DetailsPanel
isOpened={this.state.isDetailsPanelOpened}
- toggleDrawer={this.mainAppBarActions.onDetailsPanelClick} />
+ closeDrawer={this.mainAppBarActions.onDetailsPanelToggle} />