-
- {(mobile) => this.renderContent(currentTab, username, mobile)}
-
+ const currentTab = selectedTabKey();
+ const owner = isOwner();
+ const { username } = props.params;
+ const actions = renderActionButton(currentTab, username, props.t);
+
+ return (
+
+
+
+
+
+
{ownerName()}
+
+
+ {actions && (
+
{actions}
+ )}
-
- {this.state.collectionCreateVisible && (
-
-
-
- )}
-
- );
- }
-}
-
-function mapStateToProps(state) {
- return {
- previousPath: state.ide.previousPath,
- user: state.user
- };
+
+
+
+
+ {(mobile) => renderContent(currentTab, username, mobile)}
+
+
+
+ {collectionCreateVisible && (
+
+
+
+ )}
+
+ );
}
-const mapDispatchToProps = {
- ...ProjectActions
-};
-
DashboardView.propTypes = {
newProject: PropTypes.func.isRequired,
location: PropTypes.shape({
@@ -193,13 +152,27 @@ DashboardView.propTypes = {
params: PropTypes.shape({
username: PropTypes.string.isRequired
}).isRequired,
- previousPath: PropTypes.string.isRequired,
user: PropTypes.shape({
username: PropTypes.string
}),
t: PropTypes.func.isRequired
};
+DashboardView.defaultProps = {
+ user: null
+};
+
+function mapStateToProps(state) {
+ return {
+ previousPath: state.ide.previousPath,
+ user: state.user
+ };
+}
+
+const mapDispatchToProps = {
+ ...ProjectActions
+};
+
export default withTranslation()(
connect(mapStateToProps, mapDispatchToProps)(DashboardView)
);