forked from Gitlink/forgeplus-react
50 lines
1.5 KiB
JavaScript
50 lines
1.5 KiB
JavaScript
import React, { useEffect, useState } from 'react';
|
|
import { AlignCenter , FlexAJ } from '../Component/layout';
|
|
import { Link } from 'react-router-dom';
|
|
import { Dropdown , Spin } from 'antd';
|
|
import { getImageUrl } from 'educoder';
|
|
import Axios from 'axios';
|
|
|
|
function Contributors({contributors,owner,projectsId}){
|
|
|
|
// function menuFunc(login){
|
|
// let data = undefined;
|
|
// const url = `/users/${login}.json`;
|
|
// Axios.get(url).then(result=>{
|
|
// if(result && result.data){
|
|
// data = result.data;
|
|
// }
|
|
// }).catch(error=>{})
|
|
|
|
// if(data){
|
|
// return(
|
|
// <div>111</div>
|
|
// )
|
|
// }else{
|
|
// return <Spin />
|
|
// }
|
|
// }
|
|
|
|
return(
|
|
<div>
|
|
<FlexAJ>
|
|
<AlignCenter><span className="font-16 color-grey-6">贡献者</span>{ contributors && contributors.total_count > 0 && <span className="infoCount">{contributors.total_count}</span>}</AlignCenter>
|
|
<Link className="font-12 color-grey-9" to={`/projects/${owner}/${projectsId}/contribute`}>全部</Link>
|
|
</FlexAJ>
|
|
<div className="attrPerson">
|
|
{
|
|
contributors && contributors.total_count > 0 ?
|
|
contributors.list.map((item,key)=>{
|
|
return(
|
|
// <Dropdown overlay={()=>menuFunc(item.login)}>
|
|
<Link key={key} to={`/users/${item.login}`}><img src={getImageUrl(`/${item.image_url}`)} alt=""/></Link>
|
|
// </Dropdown>
|
|
)
|
|
})
|
|
:""
|
|
}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
export default Contributors; |