forgeplus-react/src/forge/UsersList/user_list.js

59 lines
1.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React, { Component } from "react";
import { Link } from "react-router-dom";
import { getImageUrl } from "educoder";
import FocusButton from "./focus_button";
import "./list.css";
class UserList extends Component {
constructor(props) {
super(props);
}
render() {
const { users, userClass } = this.props;
const renderList = () => {
if (users && users.length > 0) {
return users.map((item, key) => {
return (
<div className={`pull-left ${userClass}`} key={key}>
<div className="pbt25 grid-item mlr10 border-b-line">
<div>
<a
href={`/users/${item.login}`}
className="show-user-link"
>
<img
className="avatar-60"
src={getImageUrl(`images/${item.image_url}`)}
alt=""
/>
</a>
</div>
<div className="ml12">
<div>
<a
href={`/users/${item.login}`}
className="font-16 text-primary hide-1 task-hide max-w-200"
>
{item.name}
</a>
</div>
<div className="font-12 text-gray grid-item pb5">
<i className="iconfont icon-shijian user-join-time"></i>
<span className="ml4">加入时间{item.format_time}</span>
</div>
<FocusButton is_watch={item.is_watch} id={item.login} />
</div>
</div>
</div>
);
});
}
};
return (
renderList()
);
}
}
export default UserList;