Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 182850d

Browse files
author
Greg Rickaby
authored
Merge pull request #180 from WebDevStudios/feature/add-team-fields
Feature/add team fields
2 parents fa1ec97 + 3d87eff commit 182850d

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

api/wordpress/teams/queryTeamById.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ const singleTeamFragment = gql`
1414
${seoPostFields}
1515
${authorPostFields}
1616
${featuredImagePostFields}
17+
teamMemberProfile {
18+
facebookUrl
19+
githubUrl
20+
instagramUrl
21+
linkedinUrl
22+
location
23+
websiteUrl
24+
twitterUrl
25+
title
26+
wordpressorgProfileUrl
27+
}
1728
}
1829
`
1930

api/wordpress/teams/queryTeamsArchive.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ const archiveTeamFragment = gql`
1010
${globalPostFields}
1111
excerpt
1212
${featuredImagePostFields}
13+
teamMemberProfile {
14+
easterEggUrl
15+
}
1316
}
1417
`
1518

pages/team/[[...slug]].js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,33 @@ export default function Team({post, archive, posts, pagination}) {
7171
<Breadcrumbs breadcrumbs={post.seo.breadcrumbs} />
7272
)}
7373
<h1 dangerouslySetInnerHTML={{__html: post?.title}} />
74+
<p>{post?.teamMemberProfile?.title}</p>
7475
<Blocks blocks={post?.blocks} />
76+
{!!post?.teamMemberProfile && (
77+
// Other profiles exist; this is a sample.
78+
<ul>
79+
{!!post.teamMemberProfile.facebookUrl && (
80+
<li>
81+
<a href={post.teamMemberProfile.facebookUrl}>Facebook</a>
82+
</li>
83+
)}
84+
{!!post.teamMemberProfile.linkedinUrl && (
85+
<li>
86+
<a href={post.teamMemberProfile.linkedinUrl}>LinkedIn</a>
87+
</li>
88+
)}
89+
{!!post.teamMemberProfile.twitterUrl && (
90+
<li>
91+
<a href={post.teamMemberProfile.twitterUrl}>Twitter</a>
92+
</li>
93+
)}
94+
{!!post.teamMemberProfile.githubUrl && (
95+
<li>
96+
<a href={post.teamMemberProfile.githubUrl}>GitHub</a>
97+
</li>
98+
)}
99+
</ul>
100+
)}
75101
</article>
76102
</Container>
77103
</Layout>

0 commit comments

Comments
 (0)