diff --git a/client/modules/User/pages/DashboardView.jsx b/client/modules/User/pages/DashboardView.jsx index 3b6344b0..3713b1ee 100644 --- a/client/modules/User/pages/DashboardView.jsx +++ b/client/modules/User/pages/DashboardView.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; -import { browserHistory } from 'react-router'; +import { browserHistory, Link } from 'react-router'; import { Helmet } from 'react-helmet'; import { updateSettings, initiateVerification, createApiKey, removeApiKey } from '../actions'; import NavBasic from '../../../components/NavBasic'; @@ -60,6 +60,22 @@ class DashboardView extends React.Component { return this.props.user.username === this.props.params.username; } + renderActionButton(tabKey, username) { + if (!this.isOwner()) { + return null; + } + + switch (tabKey) { + case TabKey.assets: + return null; + case TabKey.collections: + return Create collection; + case TabKey.sketches: + default: + return New sketch; + } + } + renderContent(tabKey, username) { switch (tabKey) { case TabKey.assets: @@ -89,7 +105,11 @@ class DashboardView extends React.Component {

{this.ownerName()}

- +
+ + {this.renderActionButton(currentTab, username)} +
+
diff --git a/client/styles/components/_dashboard-header.scss b/client/styles/components/_dashboard-header.scss index 0d5d1898..5ffe6d60 100644 --- a/client/styles/components/_dashboard-header.scss +++ b/client/styles/components/_dashboard-header.scss @@ -55,3 +55,14 @@ .dashboard-header__tab__title { margin: 0; } + +.dashboard-header__actions { + display: flex; + justify-content: space-between; + align-items: center; +} + +.dashboard__action-button { + flex-grow: 0; + @extend %button; +}