-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparticipants.jsx
51 lines (45 loc) · 1.39 KB
/
participants.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//This is a component that listed the participants in a table format.
import React from "react";
import PropTypes from "prop-types";
const CircleParticipants = props => {
const mapParticipants = (people, index) => {
const getInitials = () =>
`${people.firstName.charAt(0).toUpperCase()}${people.lastName
.charAt(0)
.toUpperCase()}`;
return (
<tr key={people.sortOrder}>
<th scope="row">
<div
style={{
borderRadius: "50% ",
height: "50px",
width: "50px",
backgroundColor: props.colors[index],
backgroundImage: `url('${people.avatarUrl}')`,
backgroundSize: "contain",
color: "#fff",
textAlign: "center",
paddingTop: "16px"
}}
>
{!people.avatarUrl ? getInitials() : ""}
</div>
</th>
<th>{people.sortOrder}</th>
<th>{people.firstName + " " + people.mi + " " + people.lastName}</th>
<th style={{ wordBreak: "break-word" }}>{people.email}</th>
</tr>
);
};
return (
<tbody>
{props.participants && props.participants.map(mapParticipants)}
</tbody>
);
};
CircleParticipants.propTypes = {
colors: PropTypes.arrayOf(PropTypes.string),
participants: PropTypes.arrayOf(PropTypes.shape({}))
};
export default CircleParticipants;