Skip to content

Commit fc5252c

Browse files
committed
Add MemberBioSinglePage component with GraphQL query for member details
Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
1 parent 3ef46bd commit fc5252c

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

src/templates/executive-bio.js

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import React from "react";
2+
import { graphql } from "gatsby";
3+
4+
import SEO from "../components/seo";
5+
6+
import MemberBio from "../sections/Community/Member-single/executive_bio";
7+
8+
export const query = graphql`query MemberBioBySlug($member: String!) {
9+
allMdx(
10+
filter: {
11+
fields: { collection: { eq: "members" } }
12+
frontmatter: { name: { eq: $member }, published: { eq: true } }
13+
}
14+
) {
15+
nodes {
16+
id
17+
body
18+
frontmatter {
19+
name
20+
position
21+
github
22+
twitter
23+
email
24+
profile
25+
meshmate
26+
linkedin
27+
location
28+
badges
29+
bio
30+
executive_bio
31+
executive_position
32+
company
33+
executive_image {
34+
childImageSharp {
35+
gatsbyImageData(width: 500, layout: CONSTRAINED)
36+
}
37+
extension
38+
publicURL
39+
}
40+
}
41+
}
42+
}
43+
}
44+
`;
45+
46+
const MemberBioSinglePage = ({ data }) => {
47+
48+
49+
return (
50+
51+
<>
52+
53+
54+
<MemberBio
55+
frontmatter={data.allMdx.nodes[0].frontmatter}
56+
body={data.allMdx.nodes[0].body}
57+
/>
58+
59+
</>
60+
61+
);
62+
};
63+
64+
export default MemberBioSinglePage;
65+
66+
export const Head = ({ data }) => {
67+
return <SEO title={data.allMdx.nodes[0].frontmatter.name} image={data.allMdx.nodes[0].frontmatter.executive_image.publicURL} />;
68+
};

0 commit comments

Comments
 (0)