-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathteam.js
85 lines (80 loc) · 1.82 KB
/
team.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
import { graphql } from 'gatsby';
import _ from 'lodash';
import React from 'react';
import Layout from '../components/layout';
import { Person, rdfToPeopleArray } from '../components/person';
import SEO from '../components/seo';
export default function Team({
data: {
allRdf: { edges },
},
}) {
const people = rdfToPeopleArray(edges);
const peopleByRole = _.groupBy(
_.sortBy(people, 'role.priority'),
p => p.role.name
);
return (
<Layout>
<SEO title="Team" />
<div className="content team">
<h1 className="header">Team</h1>
{Object.keys(peopleByRole).map(role => (
<div key={role} className="mb-8">
<h2 style={{ marginBottom: '1em' }}>{role}</h2>
<div className="columns">
{peopleByRole[role]
.sort((a, b) => a.name.localeCompare(b.name))
.map(person => (
<div className="column is-one-quarter" key={person.path}>
<Person person={person} />
</div>
))}
</div>
</div>
))}
</div>
</Layout>
);
}
export const pageQuery = graphql`
query {
allRdf(
filter: {
data: {
rdf_type: {
elemMatch: { id: { eq: "https://schema.dice-research.org/Person" } }
}
}
}
) {
edges {
node {
path
data {
name
namePrefix
phone
fax
email
office
photo
content
project {
path
data {
name
}
}
role {
data {
name
priority
}
}
}
}
}
}
}
`;