-
Notifications
You must be signed in to change notification settings - Fork 0
Kayla contact form #35
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
base: main
Are you sure you want to change the base?
Changes from all commits
4bed187
46eb226
c85f2f5
9946123
6ca4ce1
1666728
6df2c8e
b492a76
7c9e539
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| "use client"; | ||
|
|
||
| import {useState} from "react"; | ||
| import styles from "./Contact.module.scss"; | ||
|
|
||
| export default function Contact() { | ||
| const [formData, setFormData] = useState({ | ||
| firstName: "", | ||
| lastName:"", | ||
| email: "", | ||
| subject:"", | ||
| message: "", | ||
| }); | ||
|
|
||
| const handleChange = (e) => { | ||
| const { name, value } = e.target; | ||
|
|
||
| setFormData((prev) => ({ | ||
| ...prev, | ||
| [name]: value, | ||
| })); | ||
| }; | ||
|
|
||
| const handleSubmit = (e) => { | ||
| e.preventDefault(); | ||
|
|
||
| console.log("Form Data:", formData); //later replace this w/ API call to send form data to backend | ||
|
|
||
| // Reset form | ||
| setFormData({ | ||
| firstName: "", | ||
| lastName: "", | ||
| email: "", | ||
| subject: "", | ||
| message: "", | ||
| }); | ||
| }; | ||
|
|
||
| return( | ||
| <section className={styles.container}> | ||
| <h2 className={styles.title}>Let's get in touch!</h2> | ||
|
|
||
| <form onSubmit={handleSubmit} className={styles.form}> | ||
| {/* Row 1 */} | ||
| <div className={styles.row}> | ||
| <div className={styles.field}> | ||
| <label>First Name</label> | ||
| <input | ||
| type="text" | ||
| name="firstName" | ||
| placeholder="Enter Your First Name Here" | ||
| value={formData.firstName} | ||
| onChange={handleChange} | ||
| required | ||
| /> | ||
| </div> | ||
|
|
||
| <div className={styles.field}> | ||
| <label>Last Name</label> | ||
| <input | ||
| type="text" | ||
| name="lastName" | ||
| placeholder="Enter Your Last Name Here" | ||
| value={formData.lastName} | ||
| onChange={handleChange} | ||
| required | ||
| /> | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* Row 2 */} | ||
| <div className={styles.row}> | ||
| <div className={styles.field}> | ||
| <label>E-mail Address</label> | ||
| <input | ||
| type="email" | ||
| name="email" | ||
| placeholder="Enter Your E-Mail Here" | ||
| value={formData.email} | ||
| onChange={handleChange} | ||
| required | ||
| /> | ||
| </div> | ||
|
|
||
| <div className={styles.field}> | ||
| <label>Subject</label> | ||
| <input | ||
| type="text" | ||
| name="subject" | ||
| placeholder="Enter Your Subject Here" | ||
| value={formData.subject} | ||
| onChange={handleChange} | ||
| required | ||
| /> | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* Message */} | ||
| <div className={styles.field}> | ||
| <label>Message</label> | ||
| <textarea | ||
| name="message" | ||
| placeholder="Enter Your Message Here" | ||
| value={formData.message} | ||
| onChange={handleChange} | ||
| required | ||
| /> | ||
| </div> | ||
|
|
||
| <button type ="submit" className={styles.submit}> | ||
| Send Message</button> | ||
| </form> | ||
| </section> | ||
| ); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| .container{ | ||
| width: 100%; | ||
| max-width:1000px; | ||
| margin: 6rem auto; | ||
| padding: 3rem; | ||
| } | ||
|
|
||
| .title{ | ||
| font-family: Oxanium; | ||
| color: var(--Navy); | ||
| font-size: 2.1rem; | ||
| font-style: normal; | ||
| font-weight: 500; | ||
| line-height: normal; | ||
| margin-bottom: 1.5rem; | ||
| } | ||
|
|
||
| .form{ | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 1rem; | ||
| } | ||
|
|
||
| .row{ | ||
| display:grid; | ||
| grid-template-columns: 1fr 1fr; | ||
| gap: 1.6rem; | ||
| } | ||
|
|
||
| .field{ | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 0.4rem; | ||
|
|
||
| } | ||
|
|
||
| .field label { | ||
| font-family: "Space Grotesk", sans-serif; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is there also sans-serif |
||
| font-size: 0.7rem; | ||
| font-weight: 300; | ||
| color: var(--dark-gray); | ||
| } | ||
| .form input, | ||
| .form textarea{ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there should only ever be one .form, all ur html element stylings that you're applying should be form should be nested and done like below
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also same thing with setting placeholder stylings, nest in whatever u need it to be and then do like &::placeholder { styling } |
||
| width: 100%; | ||
| padding: 1rem; | ||
| border-radius: 0.6rem; | ||
| border: 1px solid var(--light-gray); | ||
| font-family: "Space Grotesk", sans-serif; | ||
| color: var(--light-gray); | ||
| font-size: 0.8rem; | ||
| font-weight:200; | ||
| } | ||
|
|
||
| .form textarea{ | ||
| min-height: 140px; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be rem |
||
| resize: vertical; | ||
| } | ||
|
|
||
|
|
||
| .submit{ | ||
| align-self: flex-end; | ||
| padding: 0.7rem 2.2rem; | ||
| border-radius: 0.6rem; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ur border-radius doesn't match figma |
||
| border: 0.5px solid var(--light-gray); | ||
| background: rgba(87,87, 87, 0.80); | ||
| color: white; | ||
| margin-top: 1.2rem; | ||
| cursor: pointer; | ||
|
|
||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import Contact from "../_Contactform/Contact.jsx"; | ||
| export default function Page(){ | ||
| return( | ||
| <main> | ||
| <Contact /> | ||
| </main> | ||
| ); | ||
| } |
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.
remove this max-width