import React, { Component } from "react";
import CommonUsers from "./common_users"
class WatchUsers extends Component {
  componentDidMount=()=>{
    this.updateTitle();
  }
  componentDidUpdate=()=>{
    this.updateTitle();
  }

  updateTitle=()=>{
    const {projectDetail} = this.props;
    if(projectDetail){
      const {author, name} = projectDetail;
      document.title = `关注用户-${author.name}/${name}`
    }
  }

  render() {
    const { owner , projectsId } = this.props.match.params;
    return (
      <div>
        {projectsId &&  <CommonUsers user_type="watchers" type_title="关注列表" project_id={projectsId} current_user={this.props.current_user} owner={owner} />}
      </div>
    );
  }
}

export default WatchUsers;
