#564 hide the hubstar on a users own hub
Merged 6 years ago by abompard. Opened 6 years ago by ryanlerch.
ryanlerch/fedora-hubs hide-hubstar-on-own-hub  into  develop

@@ -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);

removed the console.log ... sorry about that!

removed the console.log ... sorry about that!

rebased onto 6a0fc37

6 years ago

Commit 704947a fixes this pull-request

Pull-Request has been merged by abompard

6 years ago

Pull-Request has been merged by abompard

6 years ago
Metadata