-
- {(mobile) => this.renderContent(currentTab, username, mobile)}
-
+ const currentTab = selectedTabKey();
+ const isOwnerFlag = isOwner();
+ const { username } = props.params;
+ const actions = renderActionButton(currentTab, username, props.t);
+
+ return (
+
+
+
+
+
+
{ownerName()}
+
+
+ {actions && (
+
{actions}
+ )}
-
- {this.state.collectionCreateVisible && (
-
-
-
- )}
-
- );
- }
+
+
+
+
+ {(mobile) => renderContent(currentTab, username, mobile)}
+
+
+
+ {collectionCreateVisible && (
+
+
+
+ )}
+
+ );
}
function mapStateToProps(state) {
@@ -185,6 +155,10 @@ const mapDispatchToProps = {
...ProjectActions
};
+DashboardView.defaultProps = {
+ user: null // Provide an appropriate default value
+};
+
DashboardView.propTypes = {
newProject: PropTypes.func.isRequired,
location: PropTypes.shape({
@@ -193,7 +167,6 @@ DashboardView.propTypes = {
params: PropTypes.shape({
username: PropTypes.string.isRequired
}).isRequired,
- previousPath: PropTypes.string.isRequired,
user: PropTypes.shape({
username: PropTypes.string
}),