-
Notifications
You must be signed in to change notification settings - Fork 55
/
TeamSection.js
90 lines (85 loc) · 2.63 KB
/
TeamSection.js
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import React from "react";
import PropTypes from "prop-types";
import PersonCard from "./PersonCard";
const TeamSection = props => {
const TITLE =
props.title === "Team" ? (
<h1 className="cv-home-showcase-heading">{props.title}</h1>
) : (
<h3 className="cv-home-showcase-heading">{props.title}</h3>
);
const MEMBERS = props.members;
const YEARS = [2020, 2019, 2018, 2017, 2016, 2015];
const memberElements =
props.title === "GSoC Students, Mentors and Interns" ? (
YEARS.map((year, index) => {
return (
<div key={index}>
<h4 className="cv-team-subsection-heading">{year}</h4>
<div className="cv-team-section-members">
{MEMBERS.map((member, index) => {
if (member.year === year) {
const NAME = member.name;
const DESCRIPTION = member.description;
const IMAGE =
member.image || require("../../images/default_person.jpg");
const LINK =
member.personal_website ||
(member.linkedin_url ||
(member.github_url || `mailto:${member.email}`));
return (
<PersonCard
key={index}
name={NAME}
description={DESCRIPTION}
image={IMAGE}
link={LINK}
/>
);
}
})}
</div>
</div>
);
})
) : (
<div className="cv-team-section-members">
{MEMBERS.map((member, index) => {
const NAME = member.name;
const DESCRIPTION = member.description;
const IMAGE =
member.image || require("../../images/default_person.jpg");
const LINK =
member.personal_website ||
(member.linkedin_url ||
(member.github_url || `mailto:${member.email}`));
return (
<PersonCard
key={index}
name={NAME}
description={DESCRIPTION}
image={IMAGE}
link={LINK}
/>
);
})}
</div>
);
return (
<div className={`cv-team-section ${props.extraClass}`}>
<div className="cv-team-section-heading">{TITLE}</div>
{memberElements}
</div>
);
};
TeamSection.defaultProps = {
title: "",
members: [],
extraClass: ""
};
TeamSection.propTypes = {
title: PropTypes.string.isRequired,
members: PropTypes.array.isRequired,
extraClass: PropTypes.string
};
export default TeamSection;