Skip to content

Commit 731772a

Browse files
Carmen TangCarmen Tang
Carmen Tang
authored and
Carmen Tang
committed
adding subscribe to newsletter option, will improve on this later
1 parent 7d081c2 commit 731772a

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

data/zipDB 2.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10172,7 +10172,7 @@ const zipDB = {
1017210172
"94303": {
1017310173
area: "Rest_Of_California",
1017410174
county: "Santa Clara",
10175-
town: "Palo Alto",
10175+
town: "Palo Alto/East Palo Alto",
1017610176
zip: "94303"
1017710177
},
1017810178
"94304": {

data/zipDB.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10172,7 +10172,7 @@ const zipDB = {
1017210172
"94303": {
1017310173
area: "Rest_Of_California",
1017410174
county: "Santa Clara",
10175-
town: "Palo Alto",
10175+
town: "Palo Alto/East Palo Alto",
1017610176
zip: "94303"
1017710177
},
1017810178
"94304": {

package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"gatsby-plugin-netlify": "^2.1.30",
3636
"gatsby-plugin-offline": "^2.2.4",
3737
"gatsby-plugin-react-helmet": "^3.1.3",
38-
"gatsby-plugin-sitemap": "^2.2.26",
38+
"gatsby-plugin-sitemap": "^2.2.27",
3939
"gatsby-source-filesystem": "^2.1.8",
4040
"i18next": "^19.0.1",
4141
"prop-types": "^15.7.2",

src/components/Contact.js

+12-6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ var contactDict = {
1919
email: "Email",
2020
cell: "Cell",
2121
includeDetails: "Share information I enter about my tenancy",
22+
subscribe: "Subscribe to newsletters from Housing Now!",
2223
disclaimer: "Any information you share is kept confidential and is only used to assist you with your case.",
2324
submitText: "Connect with us",
2425
},
@@ -30,6 +31,7 @@ var contactDict = {
3031
email: "Correo Electrónico",
3132
cell: "Celular",
3233
includeDetails: "Compartir información que ingreso sobre mi arrendamiento",
34+
subscribe: "suscribirse a boletines de Housing Now!",
3335
disclaimer: "Cualquier información que comparta se mantiene confidencial y solo se utiliza para ayudarlo con su caso.",
3436
submitText: "Conéctate con nosotros",
3537
}
@@ -47,6 +49,7 @@ class QuickContactForm extends React.Component {
4749
cell: "",
4850
email: "",
4951
includeDetails: true,
52+
subscribe: false,
5053
submitText: props.submitText,
5154
dict: contactDict,
5255
};
@@ -60,8 +63,8 @@ class QuickContactForm extends React.Component {
6063
})
6164
.then(() => {
6265
const quickFormSubmit = true;
63-
const { includeDetails, firstName, lastName, email, cell } = this.state;
64-
updateContext({ quickFormSubmit, includeDetails, firstName, lastName, email, cell });
66+
const { includeDetails, subscribe, firstName, lastName, email, cell } = this.state;
67+
updateContext({ quickFormSubmit, includeDetails, subscribe, firstName, lastName, email, cell });
6568

6669
if (this.state.submitDestination) {
6770
navigate(this.state.submitDestination);
@@ -73,7 +76,7 @@ class QuickContactForm extends React.Component {
7376

7477
};
7578

76-
checkBoxes = { "includeDetails": true };
79+
checkBoxes = { "includeDetails": true, "subscribe": true };
7780

7881
handleChange = e => {
7982
var value = e.target.value;
@@ -84,7 +87,7 @@ class QuickContactForm extends React.Component {
8487
};
8588

8689
render() {
87-
const { firstName, lastName, cell, email, includeDetails, submitText, dict, autohide } = this.state;
90+
const { firstName, lastName, cell, email, includeDetails, subscribe, submitText, dict, autohide } = this.state;
8891
return (
8992
<AppContext.Consumer>
9093
{({ appCtx, updateContext }) => (
@@ -105,8 +108,11 @@ class QuickContactForm extends React.Component {
105108
<fieldset>
106109
<label className="form-control"><input type="checkbox" name="includeDetails" checked={includeDetails} onChange={this.handleChange} /> {dict[appCtx.lang].includeDetails}</label>
107110
</fieldset>
111+
<fieldset>
112+
<label className="form-control"><input type="checkbox" name="subscribe" checked={subscribe} onChange={this.handleChange} /> {dict[appCtx.lang].subscribe}</label>
113+
</fieldset>
108114
<p className="disclaimer">{dict[appCtx.lang].disclaimer}</p>
109-
115+
110116
<button type="submit">{submitText ? submitText : dict[appCtx.lang].submitText}</button>
111117
</form>
112118
</div>
@@ -281,4 +287,4 @@ class FullContactForm extends React.Component {
281287
}
282288

283289
export default QuickContactForm;
284-
export { QuickContactForm, FullContactForm };
290+
export { QuickContactForm, FullContactForm };

0 commit comments

Comments
 (0)