From da810e3497ab31ed712372a57a0f9b8ee6450a9c Mon Sep 17 00:00:00 2001 From: Flower92 Date: Tue, 7 Jan 2020 23:13:11 +0100 Subject: [PATCH] EPNG-0005 Created registration form --- src/App.js | 21 ++------------------- src/RegistrationForm.js | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 19 deletions(-) create mode 100644 src/RegistrationForm.js diff --git a/src/App.js b/src/App.js index 298f5a0..80c8b83 100755 --- a/src/App.js +++ b/src/App.js @@ -1,28 +1,11 @@ import React, {Component} from 'react'; -import Header from './Header'; -//import Dropdown from './Dropdown'; - - -const menu = [ - { - link: '/articles', - label: 'Articles' - }, - { - link: '/contacts', - label: 'Contacts' - }, - { - link: '/posts', - label: 'Posts' - } -]; +import RegistrationForm from './RegistrationForm'; class App extends Component { render() { return (
-
+
); } diff --git a/src/RegistrationForm.js b/src/RegistrationForm.js new file mode 100644 index 0000000..48dbfa2 --- /dev/null +++ b/src/RegistrationForm.js @@ -0,0 +1,38 @@ +import React, { Component } from 'react'; + +class RegistrationForm extends Component { + constructor(props) { + super(props); + this.state = { + email: '' + }; + this.handleEmailChange = this.handleEmailChange.bind(this); + this.handleSubmit = this.handleSubmit.bind(this); + } + + handleSubmit(event) { + event.preventDefault(); + console.log('Form is submitted. Email value is', this.state.email); + } + + handleEmailChange(event) { + console.log('E-mail was changed', event.target.value); + this.setState({email:event.target.value}); + } + + render() { + return ( +
+ + +
+ ); + } +} + +export default RegistrationForm;