-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathContactUs.js
More file actions
156 lines (141 loc) · 5.82 KB
/
ContactUs.js
File metadata and controls
156 lines (141 loc) · 5.82 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
import React from "react"
import ReactDOM from "react-dom"
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import axios from 'axios';
import ContactFormContainer from '../Containers/ContactFormContainer/ContactFormContainer';
import {changePageTitle} from '../../Layout/Actions/LayoutActions';
class ContactUs extends React.Component {
constructor(props) {
super(props)
}
componentDidMount() {
const {dispatch} = this.props;
const {title} = ContactUs.getPageMeta(this.props);
dispatch(changePageTitle(title));
}
static getPageMeta() {
return {
title: `Contact Us | Data Skeptic`,
description: `We hope to respond to all inquiries, but sometimes the volume of incoming questions can cause our queue to explode. We prioritize responses to Data Skeptic members first, and to those who ask questions in a public forum like Twitter, our Facebook wall (not Facebook direct message), or Slack. Many people can benefit from responses in public places.`
}
}
onChangeEmail(event) {
console.log(event)
var i = event.target
var email = i.value
var target = event.target
var cls = "email"
var val = target.value
var dispatch = this.props.dispatch
dispatch({type: "UPDATE_ADDRESS", payload: {cls, val} })
}
onClick(event) {
var ocart = this.props.cart.toJS()
var address = ocart.address
var email = address.email
var dispatch = this.props.dispatch
var token = ""
var req = {email: email, token: token, set_active: true}
dispatch({type: "SLACK_UPDATE", payload: {msg: "Sending..."} })
var config = {}
axios
.post("/api/slack/join", req, config)
.then(function(resp) {
var data = resp['data']
var msg = data['msg']
dispatch({type: "SLACK_UPDATE", payload: {msg} })
})
.catch(function(err) {
var data = err['data']
var msg = "Sorry, we're having a problem getting that done :("
if (data != undefined) {
if (data['msg'] != undefined) {
msg = data['msg']
}
}
dispatch({type: "SLACK_UPDATE", payload: {msg} })
console.log(err)
})
}
render() {
var osite = this.props.site.toJS()
var ocart = this.props.cart.toJS()
var email = ""
var address = ocart.address
if (address != undefined) {
email = address.email
}
var slackstatus = (
<div className="slack-status">{osite.slackstatus}</div>
)
/* Had to comment this out because there was a breaking change introduced that removes the submit button
<ContactFormContainer />
*/
return (
<div className="center">
<div className="row contact-page">
<div className="col-xs-12"><h2>Contact Us</h2></div>
<div className="col-xs-12">
<p>We hope to respond to all inquiries, but sometimes the volume of incoming questions can cause our queue to explode. We prioritize responses to Data Skeptic members first, and to those who ask questions in a public forum like Twitter, our Facebook wall (not Facebook direct message), or Slack. Many people can benefit from responses in public places.</p>
<div className="row">
<div className="col-xs-12 col-sm-4 contact-person-out">
<div className="contact-person">
<a href="mailto:orders@dataskeptic.com"><img src="img/png/email-icon.png" /></a>
<span className="vcenter"><p>For inquiries related to a purchase of any kind, including membership, please contact <a href="mailto:orders@dataskeptic.com">orders@dataskeptic.com</a> for prioritized service.</p></span>
</div>
</div>
<div className="col-xs-12 col-sm-4 contact-person-out">
<div className="contact-person">
<a href="mailto:advertising@dataskeptic.com"><img src="img/png/email-icon.png" /></a>
<span className="vcenter"><p>For advertising related questions or issues, contact <a href="advertising@dataskeptic.com">advertising@dataskeptic.com</a>.</p></span>
</div>
</div>
<div className="col-xs-12 col-sm-4 contact-person-out">
<div className="contact-person">
<a href="mailto:kyle@dataskeptic.com"><img src="img/png/email-icon.png" /></a>
<span className="vcenter"><p>If you're looking to mail us something like a review copy of a book, please contact <a href="mailto:kyle@dataskeptic.com">kyle@dataskeptic.com</a>.</p></span>
</div>
</div>
</div>
<br/>
<div className="row">
<div className="col-xs-12 col-sm-6">
<div className="slack-join row">
<div className="col-xs-12 col-sm-3 slack-join-left">
<img src="/img/png/slack-icon.png" />
</div>
<div className="col-xs-12 col-sm-9 slack-join-right">
<p>To join our Slack channel, enter your email in the box below.</p>
<input onChange={this.onChangeEmail.bind(this)} className='slack-email' value={email} />
<button className="slack-button" onClick={this.onClick.bind(this)}>Join dataskeptic.slack.com</button>
{slackstatus}
</div>
</div>
</div>
<div className="col-xs-12 col-sm-6">
<br/>
<p>You can find us on Twitter via <a href="https://twitter.com/dataskeptic">@DataSkeptic</a></p>
<br/>
<p>We are on Facebook via <a href="https://www.facebook.com/dataskeptic">https://www.facebook.com/dataskeptic</a>.</p>
</div>
</div>
<br/>
<p>You can also reach us via the contact form below.</p>
<p>Please note, we often reply via the Data Skeptic blog and may share a link to our reply if its something many readers may enjoy. If so, we refer to people via firstname only. If that's an issue, let us know.</p>
</div>
<br/>
<h2>Send us a message</h2>
<ContactFormContainer/>
</div>
</div>
)
}
}
export default connect(
state => ({
cart: state.cart,
site: state.site
})
)(ContactUs)