| |
@@ -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 @@
|
| |
/>
|
| |
<h2 className="user pt-0">
|
| |
{this.props.hub.name}
|
| |
- <HubStar />
|
| |
+ {((this.props.hub.type === "team") ||
|
| |
+ (this.props.hub.type === "user" && this.props.hub.name !== this.props.currentUser.nickname)) &&
|
| |
+ <HubStar />
|
| |
+ }
|
| |
</h2>
|
| |
<h5 className="mt-1 mb-1">
|
| |
{this.props.hub.config.summary}
|
| |
@@ -34,3 +38,11 @@
|
| |
HubHeaderLeft.propTypes = {
|
| |
hub: PropTypes.object.isRequired,
|
| |
}
|
| |
+
|
| |
+ const mapStateToProps = (state) => {
|
| |
+ return {
|
| |
+ currentUser: state.currentUser,
|
| |
+ }
|
| |
+ };
|
| |
+
|
| |
+ export default connect(mapStateToProps)(HubHeaderLeft);
|
| |
fixes #561