- renderProjectPanel = (props: RouteComponentProps<{ id: string }>) => {
- if (props.match.params.id !== this.props.currentProjectId) {
- this.props.dispatch<any>(
- setProjectItem(props.match.params.id, ItemMode.ACTIVE)
- );
- }
- return <ProjectPanel
- onItemClick={item => this.props.dispatch<any>(
- setProjectItem(item.uuid, ItemMode.ACTIVE)
- )} />;
+ renderProjectPanel = (props: RouteComponentProps<{ id: string }>) => <ProjectPanel
+ onItemRouteChange={this.handleItemRouteChange}
+ onItemClick={item => this.props.dispatch<any>(setProjectItem(item.uuid, ItemMode.ACTIVE))}
+ {...props} />
+
+ handleItemRouteChange = (itemId: string) => {
+ this.props.dispatch<any>(sidePanelActions.RESET_SIDE_PANEL_ACTIVITY());
+ this.props.dispatch<any>(sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_OPEN(sidePanelData[0].id));
+ this.props.dispatch<any>(setProjectItem(itemId, ItemMode.ACTIVE));