remove save from nav when viewing another user's project
This commit is contained in:
parent
d1576bb661
commit
3cee334a21
1 changed files with 20 additions and 10 deletions
|
@ -13,6 +13,9 @@ function Nav(props) {
|
||||||
New
|
New
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{(() => { // eslint-disable-line
|
||||||
|
if (!props.project.owner || props.project.owner && props.project.owner.id === props.user.id) {
|
||||||
|
return (
|
||||||
<li className="nav__item">
|
<li className="nav__item">
|
||||||
<a
|
<a
|
||||||
className="nav__save"
|
className="nav__save"
|
||||||
|
@ -21,6 +24,9 @@ function Nav(props) {
|
||||||
Save
|
Save
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
})()}
|
||||||
{(() => { // eslint-disable-line
|
{(() => { // eslint-disable-line
|
||||||
if (props.project.id) {
|
if (props.project.id) {
|
||||||
return (
|
return (
|
||||||
|
@ -128,10 +134,14 @@ Nav.propTypes = {
|
||||||
cloneProject: PropTypes.func.isRequired,
|
cloneProject: PropTypes.func.isRequired,
|
||||||
user: PropTypes.shape({
|
user: PropTypes.shape({
|
||||||
authenticated: PropTypes.bool.isRequired,
|
authenticated: PropTypes.bool.isRequired,
|
||||||
username: PropTypes.string
|
username: PropTypes.string,
|
||||||
|
id: PropTypes.string
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
project: PropTypes.shape({
|
project: PropTypes.shape({
|
||||||
|
id: PropTypes.string,
|
||||||
|
owner: PropTypes.shape({
|
||||||
id: PropTypes.string
|
id: PropTypes.string
|
||||||
|
})
|
||||||
}),
|
}),
|
||||||
logoutUser: PropTypes.func.isRequired,
|
logoutUser: PropTypes.func.isRequired,
|
||||||
stopSketch: PropTypes.func.isRequired,
|
stopSketch: PropTypes.func.isRequired,
|
||||||
|
|
Loading…
Reference in a new issue