import './ProjectCard.scss';
import React, { Component } from 'react';
import { Card, Icon, Tooltip, message } from 'antd';
import { connect } from 'react-redux'
import { delFollow } from '../../reducer/modules/follow';
// import { Link } from 'react-router-dom';
import PropTypes from 'prop-types';
import { withRouter } from 'react-router';
@connect(
() => {
return {}
},
{
delFollow
}
)
@withRouter
class ProjectCard extends Component {
constructor(props) {
super(props);
}
static propTypes = {
projectData: PropTypes.object,
isFollowed: PropTypes.bool,
callbackResult: PropTypes.func,
history: PropTypes.object,
delFollow: PropTypes.func
}
del = () => {
console.log('del');
const id = this.props.projectData.projectid;
this.props.delFollow(id).then((res) => {
if (res.payload.data.errcode === 0) {
this.props.callbackResult();
message.success('已取消关注!');
}
});
}
add() {
console.log('add');
}
//
//
//
// } onConfirm={confirm} okText="确认" cancelText="取消">
//
//
render() {
const { projectData, isFollowed } = this.props;
return (
this.props.history.push('/project/' + projectData._id)}>
{projectData.name || projectData.projectname}
)
}
}
export default ProjectCard