Skip to content

Commit 740401d

Browse files
committed
Make navigation back to Collection List more obvious
1 parent 20c2c6c commit 740401d

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

client/components/Nav.jsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,22 @@ class Nav extends React.PureComponent {
230230
return (
231231
<ul className="nav__items-left" title="project-menu">
232232
<li className="nav__item-logo">
233-
<InlineSVG src={logoUrl} alt="p5.js logo" className="svg__logo" />
234-
</li>
235-
<li className="nav__item nav__item--no-icon">
236233
<Link to="/" className="nav__back-link">
237-
<InlineSVG src={caretLeft} className="nav__back-icon" />
238-
<span className="nav__item-header">
239-
Back to Editor
240-
</span>
234+
<InlineSVG src={logoUrl} alt="p5.js logo" className="svg__logo" />
241235
</Link>
242236
</li>
237+
{
238+
this.props.ownerName && (
239+
<li className="nav__item nav__item--no-icon">
240+
<Link to={`/${this.props.ownerName}/collections`} className="nav__back-link">
241+
<InlineSVG src={caretLeft} className="nav__back-icon" />
242+
<span className="nav__item-header">
243+
Collections
244+
</span>
245+
</Link>
246+
</li>
247+
)
248+
}
243249
</ul>
244250
);
245251
}
@@ -715,6 +721,7 @@ Nav.propTypes = {
715721
username: PropTypes.string,
716722
id: PropTypes.string
717723
}).isRequired,
724+
ownerName: PropTypes.string,
718725
project: PropTypes.shape({
719726
id: PropTypes.string,
720727
owner: PropTypes.shape({
@@ -752,7 +759,8 @@ Nav.defaultProps = {
752759
},
753760
cmController: {},
754761
layout: 'project',
755-
warnIfUnsavedChanges: undefined
762+
warnIfUnsavedChanges: undefined,
763+
ownerName: null,
756764
};
757765

758766
function mapStateToProps(state) {

client/modules/User/pages/CollectionView.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class CollectionView extends React.Component {
5656
render() {
5757
return (
5858
<div className="dashboard">
59-
<Nav layout="dashboard" />
59+
<Nav layout="dashboard" ownerName={this.ownerName()} />
6060

6161
{this.renderContent()}
6262
</div>

0 commit comments

Comments
 (0)