-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathgroups.js
157 lines (142 loc) · 4.23 KB
/
groups.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
import { graphql, Link } from 'gatsby';
import React from 'react';
import ReactMarkdown from '../../components/markdown';
import CollaboratorsNav from '../../components/collabnav';
import Layout from '../../components/layout';
import SEO from '../../components/seo';
import SideMenu from '../../components/sidemenu';
export default function Groups({
data: {
allRdf: { edges },
},
}) {
const data = edges.sort((a, b) =>
a.node.data.name.localeCompare(b.node.data.name)
);
const menu = data.map(({ node }) => ({
target: React.createRef(),
title: node.data.name,
url: node.data.name.toLowerCase(),
}));
return (
<Layout withContainer={false}>
<SEO title="Groups" />
<CollaboratorsNav activeLink="/collaborators/groups/" />
<SideMenu targets={menu} style={{ margin: 'auto' }} />
<section className="section">
<div className="container content">
<h1 className="header">Groups</h1>
{data.map(({ node }) => (
<div
className="project"
id={node.data.name.toLowerCase()}
key={node.id}
>
<h2
className="subheader"
ref={menu.find(it => it.title === node.data.name).target}
>
{node.data.name}
</h2>
<p>
{node.data.content.map((mdString, i) => (
<ReactMarkdown key={`content_${i}`} source={mdString} />
))}
</p>
<div className="columns project-extended-info">
{node.data.lead && (
<div className="column">
<h6 className="column-header">Lead</h6>
<Link to={node.data.lead.path}>
{node.data.lead.data.name}
</Link>
</div>
)}
{node.data.member && node.data.member.length > 0 && (
<div className="column staff-list">
<h6 className="column-header">Members</h6>
{node.data.member.map(person => (
<Link key={person.path} to={person.path}>
{person.data.name}
</Link>
))}
</div>
)}
{node.data.relatedProject &&
node.data.relatedProject.length > 0 && (
<div className="column staff-list">
<h6 className="column-header">Projects</h6>
{node.data.relatedProject.map(project => (
<a key={project.path} href={project.path}>
{project.data.name}
</a>
))}
</div>
)}
{node.data.relatedDemo && node.data.relatedDemo.length > 0 && (
<div className="column staff-list">
<h6 className="column-header">Demos</h6>
{node.data.relatedDemo.map(project => (
<a key={project.path} href={project.path}>
{project.data.name}
</a>
))}
</div>
)}
</div>
<div className="horizontal-separator" />
</div>
))}
</div>
</section>
</Layout>
);
}
export const pageQuery = graphql`
query {
allRdf(
filter: {
data: {
rdf_type: {
elemMatch: { id: { eq: "https://schema.dice-research.org/Group" } }
}
}
}
) {
edges {
node {
id
data {
name
tagline
relatedProject {
path
data {
name
}
}
content
lead {
path
data {
name
}
}
member {
path
data {
name
}
}
relatedDemo {
path
data {
name
}
}
}
}
}
}
}
`;