-export const SidePanel = compose(
- withStyles(styles),
- connect(undefined, mapDispatchToProps)
-)(({ classes, ...props }: WithStyles<CssRules> & SidePanelTreeProps) =>
- <div className={classes.root}>
- <SidePanelTree {...props} />
- </div>);
+const mapStateToProps = ({ router }: RootState) => ({
+ currentRoute: router.location ? router.location.pathname : '',
+});
+
+export const SidePanel = withStyles(styles)(
+ connect(mapStateToProps, mapDispatchToProps)(
+ ({ classes, ...props }: WithStyles<CssRules> & SidePanelTreeProps & { currentRoute: string }) =>
+ <Grid item xs>
+ <SidePanelButton key={props.currentRoute} />
+ <SidePanelTree {...props} />
+ </Grid>
+ ));