From da810e3497ab31ed712372a57a0f9b8ee6450a9c Mon Sep 17 00:00:00 2001 From: Flower92 Date: Tue, 7 Jan 2020 23:13:11 +0100 Subject: [PATCH 1/2] 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; From 79e1ae66e66c9d6a794ac0c3c672b073d41694bb Mon Sep 17 00:00:00 2001 From: Flower92 Date: Fri, 10 Jan 2020 20:35:54 +0100 Subject: [PATCH 2/2] EPNG-0006_new_lesson Created new files RegistrationForm.css & App.css --- src/App.css | 41 ++++------------------------------------ src/App.js | 4 +++- src/RegistrationForm.css | 14 ++++++++++++++ src/RegistrationForm.js | 4 +++- src/index.css | 1 + 5 files changed, 25 insertions(+), 39 deletions(-) mode change 100755 => 100644 src/App.css create mode 100644 src/RegistrationForm.css diff --git a/src/App.css b/src/App.css old mode 100755 new mode 100644 index 74b5e05..1a12d1b --- a/src/App.css +++ b/src/App.css @@ -1,38 +1,5 @@ -.App { - text-align: center; -} - -.App-logo { - height: 40vmin; - pointer-events: none; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } +.container { + with: 700px; + border: 1px solid green; + margin: 0 auto; } diff --git a/src/App.js b/src/App.js index 80c8b83..0c43b30 100755 --- a/src/App.js +++ b/src/App.js @@ -1,10 +1,12 @@ import React, {Component} from 'react'; +import "./App.css"; + import RegistrationForm from './RegistrationForm'; class App extends Component { render() { return ( -
+
); diff --git a/src/RegistrationForm.css b/src/RegistrationForm.css new file mode 100644 index 0000000..ad3aa9f --- /dev/null +++ b/src/RegistrationForm.css @@ -0,0 +1,14 @@ +.emailField { + width: 300px; + height: 40px; + display: block; + border-radius: 4px; + margin-bottom: 10px; +} + +.submitButton { + width: 300px; + background: blue; + height: 50px; + border: 0; +} diff --git a/src/RegistrationForm.js b/src/RegistrationForm.js index 48dbfa2..86812ae 100644 --- a/src/RegistrationForm.js +++ b/src/RegistrationForm.js @@ -1,4 +1,5 @@ import React, { Component } from 'react'; +import './RegistrationForm.css'; class RegistrationForm extends Component { constructor(props) { @@ -28,8 +29,9 @@ class RegistrationForm extends Component { placeholder="E-mail" value={this.state.email} onChange={this.handleEmailChange} + className="emailField" /> - + ); } diff --git a/src/index.css b/src/index.css index ec2585e..d0d3bbd 100755 --- a/src/index.css +++ b/src/index.css @@ -5,6 +5,7 @@ body { sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; + background: #F5F5F5; } code {