- render() {
- const { classes, onCloseDrawer, isOpened } = this.props;
- const { tabsValue } = this.state;
- return (
- <div className={classnames([classes.container, { [classes.opened]: isOpened }])}>
- <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>
- <IconButton color="inherit" onClick={onCloseDrawer}>
- <CloseIcon />
- </IconButton>
- </Grid>
- </Typography>
- <Tabs value={tabsValue} onChange={this.handleChange}>
- <Tab disableRipple label="Details" />
- <Tab disableRipple label="Activity" />
- </Tabs>
- {tabsValue === 0 && this.renderTabContainer(
- <Grid container>
- <Grid item xs={6} sm={4} className={classes.gridLabel}>
- <p>Type</p>
- <p>Size</p>
- <p>Location</p>
- <p>Owner</p>
- </Grid>
- <Grid item xs={6} sm={4}>
- <p>Process</p>
- <p>---</p>
- <p>Projects</p>
- <p>me</p>
- </Grid>
- </Grid>
- )}
- {tabsValue === 1 && this.renderTabContainer(
- <Grid container>
- <Grid item xs={6} sm={4} className={classes.gridLabel}>
- <p>Type</p>
- <p>Size</p>
- <p>Location</p>
- <p>Owner</p>
- </Grid>
- <Grid item xs={6} sm={4}>
- <p>Process</p>
- <p>---</p>
- <p>Projects</p>
- <p>me</p>
- </Grid>
- </Grid>
- )}
- </Drawer>
- </div>
- );
+const mapStateToProps = ({ detailsPanel, resources, resourcesData }: RootState) => {
+ const resource = getResource(detailsPanel.resourceUuid)(resources) as DetailsResource;
+ const resourceData = getResourceData(detailsPanel.resourceUuid)(resourcesData);
+ return {
+ isOpened: detailsPanel.isOpened,
+ item: getItem(resource, resourceData)
+ };
+};
+
+const mapDispatchToProps = (dispatch: Dispatch) => ({
+ onCloseDrawer: () => {
+ dispatch<any>(toggleDetailsPanel());