diff --git a/web/dist/main.css b/web/dist/main.css index 911e1df..51c4798 100644 --- a/web/dist/main.css +++ b/web/dist/main.css @@ -757,7 +757,8 @@ html { padding: 15px 0; } -.ld-check-availability button { +.ld-check-availability button, +.contact-form button { font-size: 18px; padding: 15px 0; background-color: #51bc6a; @@ -858,7 +859,7 @@ h5 { .modal h3 { color: #575a60; - font-size: 16px; + font-size: 18px; font-weight: 400; letter-spacing: .3px; } @@ -875,6 +876,66 @@ h5 { font-size: 1.2em; } -.close:hover { - /*background: #00d9ff;*/ +.contact-form input, textarea { + padding: 10px; + border: 1px solid #e2e2e6; + width: 420px; + border-radius: 3px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + font-size: 14px; + color: #212126; + letter-spacing: .2px; +} + +.contact-form-email-phone input { +} + +.contact-form-email-phone input:first-child { + margin-right: 5px; + width: 250px; +} + +.contact-form-email-phone input:last-child { + margin-left: 5px; + width: 160px; +} + +.contact-form-name, +.contact-form-message, +.contact-form-email-phone { + margin-top: 15px; + margin-bottom: 15px; +} + +.contact-form-footer { + text-align: center; + padding-top: 20px; + padding-bottom: 15px; +} + +.contact-form-alert input { + width: 15px; +} + +.contact-form-alert span { + cursor: pointer; +} + +.contact-form-alert { + font-size: 0.9em; +} + +.noselect { + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Safari */ + -khtml-user-select: none; /* Konqueror HTML */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* Internet Explorer/Edge */ + user-select: none; /* Non-prefixed version, currently + supported by Chrome and Opera */ +} + +input.validation-failed { + border: 1px solid red; } diff --git a/web/src/components/ContactModal.js b/web/src/components/ContactModal.js index 40a7544..da263d2 100644 --- a/web/src/components/ContactModal.js +++ b/web/src/components/ContactModal.js @@ -1,30 +1,124 @@ -import React from 'react'; +import React from 'react' export default class ContactModal extends React.Component { - onContactCloseClick () { - - } - onContactCloseClick (e) { + e.preventDefault() + this.props.dispatch({ type: 'CLOSE_CONTACT' - }); - - e.preventDefault(); + }) } + onSubmit (e) { + e.preventDefault() + const {name, email} = this.props.contact; + + if (!name || !email) { + this.props.dispatch({ + type: 'INVALID_CONTACT' + }) + } else { + this.props.dispatch({ + type: 'SUBMIT_CONTACT' + }) + } + } + + onFieldChange (field, e) { + this.props.dispatch({ + type: 'UPDATE_CONTACT_INFO', + action: { + field, + value: e.target.value + } + }) + } + + onAlertToggle (e) { + const alert = this.props.contact.alert + this.props.dispatch({ + type: 'UPDATE_CONTACT_INFO', + action: { + field: 'alert', + value: !alert + } + }) + } + + render () { + const { + message, + email, + phone, + name, + alert: doAlert, + nameInvalid, + emailInvalid + } = this.props.contact + + const nameValidationClass = nameInvalid ? 'validation-failed' : '' + const emailValidationClass = emailInvalid ? 'validation-failed' : '' - render() { return ( -
- +
- - + +