From 907c364dbc0173fb98f49b2b9054dd1b2706bc45 Mon Sep 17 00:00:00 2001
From: Ram Reddy <69733662+ramnreddy15@users.noreply.github.com>
Date: Wed, 3 Feb 2021 12:49:24 -0500
Subject: [PATCH] Basic form for contact
Doesn't fully work yet.
---
src/App.js | 6 ++---
src/components/Contact.js | 56 ++++++++++++++++++++++++++++++++++++---
2 files changed, 56 insertions(+), 6 deletions(-)
diff --git a/src/App.js b/src/App.js
index 3b0d622..83fecd2 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,7 +1,7 @@
-import React from "react";
+import React, {Component} from "react";
import { BrowserRouter, Route, Switch } from "react-router-dom";
import About from "./components/About";
-import Contact from "./components/Contact";
+import ContactForm from "./components/Contact";
import Home from "./components/Home";
import PostDetail from "./components/PostDetail";
import Blog from "./components/Blog";
@@ -13,7 +13,7 @@ function App() {
-
+
diff --git a/src/components/Contact.js b/src/components/Contact.js
index 583ed85..494245e 100644
--- a/src/components/Contact.js
+++ b/src/components/Contact.js
@@ -1,5 +1,55 @@
-import React from "react";
+import React, {Component} from "react";
-export default function Contact(props) {
- return Contact
;
+class ContactForm extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ name: 'Write your full name here.',
+ email: 'Write your email here.',
+ subject: 'Write why you are writing here.',
+ message: 'Write your message here.'
+ };
+
+ this.handleChange = this.handleChange.bind(this);
+ this.handleSubmit = this.handleSubmit.bind(this);
+ }
+
+ handleChange(event) {
+ this.setState({name: event.target.name});
+ this.setState({email: event.target.email});
+ this.setState({subject: event.target.subject});
+ this.setState({message: event.target.message});
+ }
+
+ handleSubmit(event) {
+ alert('You will get and email from us shortly!');
+ alert('These are the details you have submitted!' + this.state.name);
+ event.preventDefault();
+ }
+
+ render() {
+ return (
+
+ );
+ }
}
+
+export default ContactForm;
\ No newline at end of file