-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact-template.js
88 lines (85 loc) · 2.17 KB
/
contact-template.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
import { graphql } from 'gatsby';
import React from 'react'
import Layout from '../components/Layout.js';
import PageHeader from '../components/PageHeader.js';
const ContactTemplate = (props) => {
return (
<Layout page={props.data.markdownRemark.frontmatter}>
<PageHeader frontmatter={props.data.markdownRemark.frontmatter} />
<div
dangerouslySetInnerHTML={{
__html: `
${props.data.markdownRemark.html}
<ul>
<li>
<a href="mailto:${props.data.settings.frontmatter.settings.email}" rel="noreferrer nofollow">
Mail
</a>
</li>
<li>
<a href="${props.data.settings.frontmatter.settings.facebook}" rel="noreferrer nofollow">
Facebook
</a>
</li>
<li>
<a href="${props.data.settings.frontmatter.settings.twitter}" rel="noreferrer nofollow">
Twitter
</a>
</li>
<li>
<a href="${props.data.settings.frontmatter.settings.youtube}" rel="noreferrer nofollow">
YouTube
</a>
</li>
</ul>
`
}}
className='
container
py-8 px-4
md:px-0
prose
prose-p:text-stone-900
prose-img:rounded-lg
'>
</div>
</Layout>
)
}
export const query = graphql`
query($pageId: String = "") {
markdownRemark(id: { eq: $pageId }) {
id
fields {
slug
}
frontmatter {
title
description
featuredImage {
childImageSharp {
gatsbyImageData
resize(width: 1200, height: 630, fit: CONTAIN, background: "#fafaf9") {
src
}
}
}
}
html
}
settings: markdownRemark(frontmatter: {contentKey: {eq: "setting"}}) {
frontmatter {
title
description
settings {
siteTitle
email
facebook
twitter
youtube
}
}
}
}
`
export default ContactTemplate