From 6a0fc370b2923c43c0298584b6f2f7d915ea74ae Mon Sep 17 00:00:00 2001 From: Ryan Lerch Date: Feb 08 2018 10:01:34 +0000 Subject: hide the hubstar on a users own hub fixes #561 --- diff --git a/js/app/components/HubHeader/HubHeaderLeft.js b/js/app/components/HubHeader/HubHeaderLeft.js index 9e76ad6..4c06c36 100644 --- a/js/app/components/HubHeader/HubHeaderLeft.js +++ b/js/app/components/HubHeader/HubHeaderLeft.js @@ -1,11 +1,12 @@ import React from 'react'; +import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import HubStats from './HubStats'; import HubStar from './HubStar'; import HubAvatar from './HubAvatar'; -export default class HubHeaderLeft extends React.Component { +class HubHeaderLeft extends React.Component { render() { return ( @@ -20,7 +21,10 @@ export default class HubHeaderLeft extends React.Component { />

{this.props.hub.name} - + {((this.props.hub.type === "team") || + (this.props.hub.type === "user" && this.props.hub.name !== this.props.currentUser.nickname)) && + + }

{this.props.hub.config.summary} @@ -34,3 +38,11 @@ export default class HubHeaderLeft extends React.Component { HubHeaderLeft.propTypes = { hub: PropTypes.object.isRequired, } + +const mapStateToProps = (state) => { + return { + currentUser: state.currentUser, + } +}; + +export default connect(mapStateToProps)(HubHeaderLeft);