-
Notifications
You must be signed in to change notification settings - Fork 0
Fe 10 migrate the contact page #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ZeeshanTamboli
wants to merge
4
commits into
dev
Choose a base branch
from
FE-10_migrate_the_contact_page
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| .c-contact { | ||
| text-align: center; | ||
| form { | ||
| max-width: 400px; | ||
| margin: 40px auto; | ||
| } | ||
| h1 { | ||
| font-size: 2.4rem; | ||
| line-height: 1; | ||
| } | ||
| input, | ||
| textarea { | ||
| font-size: 16px; | ||
| } | ||
| textarea { | ||
| height: 125px; | ||
| padding: 0.7em; | ||
| max-width: 100%; | ||
| display: block; | ||
| box-sizing: border-box; | ||
| width: 100%; | ||
| padding: 0.5rem; | ||
| border: 1px solid #dee0e9; | ||
| margin: 0 0 1rem; | ||
| font-family: inherit; | ||
| font-size: 1rem; | ||
| color: #3a405b; | ||
| background-color: #fff; | ||
| box-shadow: none; | ||
| border-radius: 2px; | ||
| transition: box-shadow 0.5s, border-color 0.25s ease-in-out; | ||
| -webkit-appearance: none; | ||
| -moz-appearance: none; | ||
| } | ||
| input[type='text'], | ||
| [type='email'] { | ||
| height: 2.9rem; | ||
| padding: 0.7em; | ||
| display: block; | ||
| box-sizing: border-box; | ||
| width: 100%; | ||
| height: 2.4375rem; | ||
| padding: 0.5rem; | ||
| border: 1px solid #dee0e9; | ||
| margin: 0 0 1rem; | ||
| font-family: inherit; | ||
| font-size: 1rem; | ||
| color: #3a405b; | ||
| background-color: #fff; | ||
| box-shadow: none; | ||
| border-radius: 2px; | ||
| transition: box-shadow 0.5s, border-color 0.25s ease-in-out; | ||
| -webkit-appearance: none; | ||
| -moz-appearance: none; | ||
| } | ||
|
|
||
| .button--block { | ||
| width: 100%; | ||
| } | ||
| .button--success { | ||
| background: #4be1ab; | ||
| color: #fff; | ||
| } | ||
|
|
||
| .button { | ||
| font-weight: 600; | ||
| display: inline-block; | ||
| text-align: center; | ||
| line-height: 1; | ||
| cursor: pointer; | ||
| -webkit-appearance: none; | ||
| transition: background-color 0.25s ease-out, color 0.25s ease-out; | ||
| vertical-align: middle; | ||
| border: 1px solid transparent; | ||
| border-radius: 4px; | ||
| padding: 0.75em 1em; | ||
| margin: 0; | ||
| font-size: 1.1rem; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| import React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import { withFormik, Form, Field } from 'formik'; | ||
| import * as Yup from 'yup'; | ||
| import './contact.scss'; | ||
|
|
||
| const Contact = ({ errors, touched }) => ( | ||
| <section className="c-section c-contact u-padding-v-xlarge"> | ||
| <h1>Get in touch</h1> | ||
| <p>We'll love to hear from you!</p> | ||
| <Form> | ||
| <div> | ||
| {touched.name && errors.name ? ( | ||
| <p style={{ color: 'red' }}>{errors.name}</p> | ||
| ) : null} | ||
| <Field | ||
| id="Name" | ||
| type="text" | ||
| name="name" | ||
| autoComplete="name" | ||
| placeholder="Your Name" | ||
| /> | ||
| </div> | ||
| <div> | ||
| {touched.email && errors.email ? ( | ||
| <p style={{ color: 'red' }}>{errors.email}</p> | ||
| ) : null} | ||
| <Field | ||
| id="message" | ||
| type="email" | ||
| name="email" | ||
| autoComplete="email" | ||
| placeholder="Your Email" | ||
| /> | ||
| </div> | ||
| <div> | ||
| {touched.message && errors.message ? ( | ||
| <p style={{ color: 'red' }}>{errors.message}</p> | ||
| ) : null} | ||
| <Field | ||
| component="textarea" | ||
| name="message" | ||
| id="message" | ||
| placeholder="Your Message" | ||
| /> | ||
| </div> | ||
| <button type="submit" className="button button--success button--block"> | ||
| Send Message | ||
| </button> | ||
| </Form> | ||
| </section> | ||
| ); | ||
|
|
||
| Contact.propTypes = { | ||
| errors: PropTypes.object.isRequired, | ||
| touched: PropTypes.object.isRequired, | ||
| }; | ||
|
|
||
| export default withFormik({ | ||
| mapPropsToValues: () => ({ | ||
| name: '', | ||
| email: '', | ||
| message: '', | ||
| }), | ||
| validationSchema: Yup.object().shape({ | ||
| name: Yup.string().required('Name is required'), | ||
| email: Yup.string() | ||
| .email('Email not valid') | ||
| .required('Email is required'), | ||
| message: Yup.string().required('Message is required'), | ||
| }), | ||
| handleSubmit: values => { | ||
| // Handle http request here | ||
| console.log(values); | ||
| }, | ||
| })(Contact); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ZeeshanTamboli I think we have to remove all
consolestatements, I also think if there is something we want to implement later we can add it as a// TODO: implement this feature #16and we can create an issue for it and add its issue number to the comment.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that this PR LGTM. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Removed
consolestatements and added comment. Created an issue as well. My Circle CI tests are failing. After running tests locally it shows -How do I resolve this?