From 292e5552aa96f1c713df6160bd806c2fdee1a6e3 Mon Sep 17 00:00:00 2001 From: Ram Reddy <69733662+ramnreddy15@users.noreply.github.com> Date: Thu, 4 Feb 2021 22:42:52 -0500 Subject: [PATCH] Finished contact --- public/index.html | 1 + src/components/Contact.js | 22 ++++++++++- src/components/assets/StyledContactForm.js | 13 +++++- src/components/assets/contact.css | 46 ++++++++++++++++++++++ 4 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 src/components/assets/contact.css diff --git a/public/index.html b/public/index.html index 091ff88..421fb63 100644 --- a/public/index.html +++ b/public/index.html @@ -3,6 +3,7 @@
+ diff --git a/src/components/Contact.js b/src/components/Contact.js index d72f134..6fb1e9c 100644 --- a/src/components/Contact.js +++ b/src/components/Contact.js @@ -1,8 +1,8 @@ import React, {Component} from "react"; import emailjs from "emailjs-com"; import styled, {createGlobalStyle} from 'styled-components'; -import {StyledFormWrapper, StyledForm, StyledButton, StyledError, StyledInput, StyledTextArea, sharedStyles, StyledTextAreaSubject} from "./assets/StyledContactForm.js"; - +import {StyledFormWrapper, StyledForm, StyledButton, StyledError, StyledInput, StyledTextArea, sharedStyles, StyledTextAreaSubject, ButtonSet} from "./assets/StyledContactForm.js"; +import './assets/contact.css' const GlobalStyle = createGlobalStyle` html { @@ -34,6 +34,7 @@ class ContactForm extends Component { this.handleSubjectChange = this.handleSubjectChange.bind(this); this.handleMessageChange = this.handleMessageChange.bind(this); this.handleSubmit = this.handleSubmit.bind(this); + this.scrollDown = this.scrollDown.bind(this); } handleNameChange(event) { @@ -88,6 +89,16 @@ class ContactForm extends Component { event.target.reset(); } + scrollDown(id) { + const element = document.getElementById(id); + element.scrollIntoView({ + behavior: "smooth", + block: "end", + inline: "nearest" + }); + + } + render() { return ( @@ -125,9 +136,16 @@ class ContactForm extends Component {