Skip to content

Commit 12f1b03

Browse files
committed
Update contact form widget
1 parent 6860ec3 commit 12f1b03

File tree

3 files changed

+44
-17
lines changed

3 files changed

+44
-17
lines changed

example/site-config.js

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
siteUrl: "https://yourwordpressblog.com", // Site domain. Do not include a trailing slash!
2+
siteUrl: "https://wp-balsa-preview.draftbox.co", // Site domain. Do not include a trailing slash!
33

44
postsPerPage: 10, // Number of posts shown on paginated pages (changes this requires sometimes to delete the cache)
55

@@ -13,47 +13,47 @@ module.exports = {
1313
shortTitle: "Wordpress", // Used for App manifest e.g. Mobile Home Screen
1414
siteIcon: "favicon.png", // Logo in /static dir used for SEO, RSS, and App manifest
1515
backgroundColor: "#e9e9e9", // Used for Offline Manifest
16-
themeColor: "#15171A", // Used for Offline Manifest,
17-
apiUrl: "https://gatsbylibre2.wordpress.com",
16+
themeColor: "#15171A", // Used for Offline Manifest
17+
apiUrl: "https://wordpress.theasdfghjkl.com",
1818
subscribeWidget: {
1919
title: "Subscribe to Draftbox",
2020
helpText: "Get the latest posts delivered right to your inbox.",
21-
successMessage: "Thanks for subscribing to Built with Draftbox.",
21+
successMessage: "Thanks for subscribing to Draftbox.",
2222
},
2323
header: {
2424
navigation: [
2525
{
2626
label: "Home",
27-
url: "https://gatsbylibre2.wordpress.com/",
27+
url: "https://wp-balsa-preview.draftbox.co/",
2828
},
2929
{
3030
label: "Contact",
31-
url: "https://gatsbylibre2.wordpress.com/contact",
31+
url: "https://wp-balsa-preview.draftbox.co/contact",
3232
},
3333
{
3434
label: "Contact1111",
35-
url: "https://gatsbylibre2.wordpress.com/contact111",
35+
url: "https://wp-balsa-preview.draftbox.co/contact111",
3636
},
3737
],
3838
},
3939
footer: {
40-
copyright: "Built with Draftbox122",
40+
copyright: "Built with Draftbox",
4141
navigation: [
4242
{
4343
label: "Home",
44-
url: "https://gatsbylibre2.wordpress.com/",
44+
url: "https://wp-balsa-preview.draftbox.co/",
4545
},
4646
{
4747
label: "Sitemap",
48-
url: "https://gatsbylibre2.wordpress.com/sitemap.xml",
48+
url: "https://wp-balsa-preview.draftbox.co/sitemap.xml",
4949
},
5050
{
5151
label: "RSS",
52-
url: "https://gatsbylibre2.wordpress.com/rss.xml",
52+
url: "https://wp-balsa-preview.draftbox.co/rss.xml",
5353
},
5454
{
5555
label: "Contact",
56-
url: "https://gatsbylibre2.wordpress.com/contact",
56+
url: "https://wp-balsa-preview.draftbox.co/contact",
5757
},
5858
{
5959
label: "External Link",
@@ -63,9 +63,13 @@ module.exports = {
6363
},
6464
socialLinks: {
6565
twitter: "https://twitter.com/draftboxhq",
66-
facebook: "https://facebook.com/draftboxhq",
67-
instagram: "https://www.instagram.com/draftboxhq_uploads",
66+
facebook: "https://facebook.com/",
67+
instagram: "https://www.instagram.com/",
6868
linkedin: "https://linkedin.com/",
6969
github: "https://github.com/draftbox-co",
7070
},
71+
contactWidget: {
72+
title: "Contact Built with Draftbox",
73+
successMessage: "We’ll get in touch with you soon.",
74+
},
7175
};

gatsby-wordpress-theme-libre/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@draftbox-co/gatsby-wordpress-theme-libre",
3-
"version": "1.0.25",
3+
"version": "1.0.26",
44
"license": "MIT",
55
"resolutions": {
66
"sharp": "0.23.4"

gatsby-wordpress-theme-libre/src/components/contact-form.jsx

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,29 @@ import React, { useState } from "react";
22
import { useForm } from "../hook/useForm";
33
import Navbar from "./navbar";
44
import "../styles/contact-form.css";
5+
import { useStaticQuery, graphql } from "gatsby";
56

67
const ContactForm = () => {
8+
9+
const {
10+
wpSiteMetaData: { name },
11+
site: {siteMetadata: {contactWidget}}
12+
} = useStaticQuery(graphql`
13+
query {
14+
wpSiteMetaData {
15+
...WordpressSiteMetaData
16+
}
17+
site {
18+
siteMetadata {
19+
contactWidget {
20+
title
21+
successMessage
22+
}
23+
}
24+
}
25+
}
26+
`);
27+
728
const [formValues, setFormValues] = useState({
829
name: "",
930
email: "",
@@ -47,12 +68,14 @@ const ContactForm = () => {
4768
<div className="inner">
4869
{succeeded && (
4970
<h1 className="entry-title-header">
50-
We’ll get in touch with you soon.
71+
{contactWidget.successMessage ? contactWidget.successMessage : `We'll get in touch with you soon.`}
5172
</h1>
5273
)}
5374
{!succeeded && (
5475
<>
55-
<h1 className="entry-title-header">Contact</h1>
76+
<h1 className="entry-title-header">
77+
<span dangerouslySetInnerHTML={{ __html: contactWidget.title ? contactWidget.title : `Contact ` + name }}></span>
78+
</h1>
5679
<form
5780
className="form-content"
5881
onSubmit={e => handleSubmit(e)}

0 commit comments

Comments
 (0)