forgeplus-react/src/forge/Component/MemberCards.jsx

61 lines
1.5 KiB
React
Raw Normal View History

2020-06-11 15:40:22 +08:00
import React from 'react';
import './Component.scss';
2021-01-31 22:24:46 +08:00
import { Button } from 'antd';
2020-06-11 15:40:22 +08:00
import styled from 'styled-components';
2021-01-31 22:24:46 +08:00
import FocusButton from "../UsersList/focus_button";
2021-02-02 09:31:15 +08:00
import { getImageUrl } from 'educoder';
2021-02-03 17:00:46 +08:00
import { Link } from 'react-router-dom';
2020-06-11 15:40:22 +08:00
const Img = styled.img`{
border-radius:50%;
width:50px;
height:50px;
margin-right:14px;
}`
const Name = styled.div`{
color:#5091FF;
font-size:16px;
height:22px;
line-height:22px;
margin-bottom:7px;
}`
const Time = styled.div`{
color:#888;
font-size:12px;
height:16px;
line-height:16px;
margin-bottom:9px;
display:flex;
align-item:center;
}`
const I = styled.i`{
font-size:13px!important;
color:#60B25E;
margin-right:2px;
2021-02-05 16:19:35 +08:00
height:17px;
line-height:17px;
2020-06-11 15:40:22 +08:00
}`
const Div = styled.div`{
margin-bottom: 18px;
padding:20px 16px;
display: flex;
align-items: center;
border:1px solid #eee;
}`
2021-02-03 17:00:46 +08:00
export default (({ user , img, name, time, focusStatus, is_current_user, login , successFunc }) => {
2021-01-31 22:24:46 +08:00
return (
2020-06-11 15:40:22 +08:00
<Div>
2021-08-30 10:31:51 +08:00
<Link to={`/${user && user.login}`}><Img src={getImageUrl(`/${img}`)} /></Link>
2020-06-11 15:40:22 +08:00
<div className="m-infos">
2021-08-30 10:31:51 +08:00
<Link to={`/${user && user.login}`}><Name>{name}</Name></Link>
2020-06-11 15:40:22 +08:00
<Time><I className="iconfont icon-shijian"></I>加入时间:{time}</Time>
{
2021-01-31 22:24:46 +08:00
is_current_user ?
2021-02-03 15:53:15 +08:00
<Button type="default">当前用户</Button>
:
2021-09-03 17:14:45 +08:00
<FocusButton is_watch={focusStatus} id={login} successFunc={successFunc} notReset={true}/>
2020-06-11 15:40:22 +08:00
}
</div>
</Div>
)
})