From 1c9dc1ea4dd57c3f3a5edb8c1587f582d68af359 Mon Sep 17 00:00:00 2001 From: "alexander.shugaev" Date: Tue, 11 Dec 2018 14:40:43 +0200 Subject: [PATCH 1/5] initial form component commit --- .idea/inspectionProfiles/Project_Default.xml | 6 + .idea/masa-review-client.iml | 12 + .idea/misc.xml | 6 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 241 + package-lock.json | 6198 +++++++++--------- src/App.js | 16 +- src/components/form/index.js | 16 + 9 files changed, 3403 insertions(+), 3106 deletions(-) create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/masa-review-client.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 src/components/form/index.js diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..c6cc8c8 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/masa-review-client.iml b/.idea/masa-review-client.iml new file mode 100644 index 0000000..24643cc --- /dev/null +++ b/.idea/masa-review-client.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..24eb271 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..b9afeb8 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..ad817af --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -157,6 +180,12 @@ + + + + + + + + + + + + + + + + @@ -179,12 +218,12 @@ - @@ -200,7 +239,7 @@ - + @@ -219,23 +258,33 @@ - - + + + + + - - + + + + + + + + + \ No newline at end of file diff --git a/src/App.js b/src/App.js index 12fc87e..bb3653a 100644 --- a/src/App.js +++ b/src/App.js @@ -2,6 +2,7 @@ import React, { Component } from 'react'; import logo from './logo.svg'; import './App.css'; import Form from './components/form/' +import 'bootstrap/dist/css/bootstrap.css'; class App extends Component { render() { diff --git a/src/components/form/index.js b/src/components/form/index.js index 8febf75..9445d43 100644 --- a/src/components/form/index.js +++ b/src/components/form/index.js @@ -1,13 +1,54 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; + class Form extends Component { render() { return ( -
- privetik +
+
+
+
+
+
+

Create a Masa Review account

+
+ + +
+ +
+ + + The password must contain at least + eight characters, including letters, numbers and special characters. + +
+
+
+
+ +
+
+ +
+
+
+
+ formmasa +

Share your expirience!

+
+
+
+
- ); + ) + ; } } diff --git a/src/index.css b/src/index.css index cee5f34..03659a4 100644 --- a/src/index.css +++ b/src/index.css @@ -12,3 +12,7 @@ code { font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace; } + +.formmasa{ + min-width: 1000px; +} From 83ec9bba0aab48179ddf679ec933ef7b146077bd Mon Sep 17 00:00:00 2001 From: "alexander.shugaev" Date: Sat, 15 Dec 2018 19:54:14 +0200 Subject: [PATCH 3/5] validation is done --- .gitignore | 1 + .idea/workspace.xml | 128 ++++++++++++++++++++++------------- src/App.js | 86 ++++++++++++++++++++--- src/components/form/index.js | 44 ++++++++---- src/tools/formValidator.js | 39 +++++++++++ 5 files changed, 229 insertions(+), 69 deletions(-) create mode 100644 src/tools/formValidator.js diff --git a/.gitignore b/.gitignore index 4d29575..9429f0c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. +/.idea # dependencies /node_modules /.pnp diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6efd958..245857b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,11 @@ + + + - @@ -20,73 +22,84 @@ - + + + - + - + + - + + - + + - + - + - - + + - + - + - - - - - + + - + + + + + + + + + + - - + + @@ -106,9 +119,12 @@ @@ -129,7 +145,8 @@ - @@ -138,6 +155,7 @@ + @@ -167,7 +185,6 @@ + placeholder="Name" + value={inputName} + onChange={change1}/> + placeholder="Surname" + value={inputSurName} + onChange={change2}/>
+ type="email" + placeholder="Email" + value={inputEmail} + onChange={change3}/>
- - + + The password must contain at least eight characters, including letters, numbers and special characters. @@ -35,12 +51,16 @@ class Form extends Component {
- +
- formmasa + formmasa

Share your expirience!

@@ -52,6 +72,4 @@ class Form extends Component { } } -Form.propTypes = {}; - export default Form; diff --git a/src/tools/formValidator.js b/src/tools/formValidator.js new file mode 100644 index 0000000..4c2ebef --- /dev/null +++ b/src/tools/formValidator.js @@ -0,0 +1,39 @@ +export default function formValidator(inputConPass, inputPass, inputName, inputEmail, inputSurName) { + let inputPassValid = false; + let inputNameValid = false; + let inputEmailValid = false; + let inputSurNameValid = false; + let formValid = false; + + //Name validation + + if (inputName.length > 0) { + inputNameValid = true + } + + //Surname validation + + if (inputSurName.length > 0) { + inputSurNameValid = true + } + + //password confirmization and validation + + if (inputPass.length >= 8 && inputConPass.length >= 8 && inputPass === inputConPass) { + inputPassValid = true + } + + //Email validation + + const re = /^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i; + if (re.test(inputEmail)) { + inputEmailValid = true; + } + + + formValid = inputPassValid + && inputNameValid + && inputEmailValid + && inputSurNameValid; + return formValid +} \ No newline at end of file From fe57164c96e68b8391ae971a0893e7a30a95cba3 Mon Sep 17 00:00:00 2001 From: "alexander.shugaev" Date: Sat, 15 Dec 2018 22:19:41 +0200 Subject: [PATCH 4/5] ispravlena oshibka --- .idea/workspace.xml | 18 ++++++------------ src/App.js | 2 -- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 245857b..cad74fa 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,13 +1,7 @@ - - - - - - - + @@ -21,6 +15,7 @@ + @@ -144,7 +139,7 @@ - + - - - + diff --git a/src/App.js b/src/App.js index 51954b6..4dca011 100644 --- a/src/App.js +++ b/src/App.js @@ -2,7 +2,6 @@ import React, {Component} from 'react'; import './App.css'; import Form from './components/form/' import 'bootstrap/dist/css/bootstrap.css'; -import emails from './components/form/emails'; import formValidator from './tools/formValidator'; class App extends Component { @@ -74,7 +73,6 @@ class App extends Component { change4={this._onChangeInputPass} change5={this._onChangeInputConPass} nameValid={this.state.nameValid} - emails={emails} formValid={this.state.formValid} /> From 657c9ea3198b737fb7e3f22fba35f3179cfde798 Mon Sep 17 00:00:00 2001 From: "alexander.shugaev" Date: Sun, 30 Dec 2018 14:30:40 +0200 Subject: [PATCH 5/5] modifided gitignore --- .circleci/config.yml | 20 -- .gitignore | 2 +- .idea/inspectionProfiles/Project_Default.xml | 6 - .idea/masa-review-client.iml | 12 - .idea/misc.xml | 6 - .idea/modules.xml | 8 - .idea/vcs.xml | 6 - .idea/workspace.xml | 318 ------------------- 8 files changed, 1 insertion(+), 377 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/masa-review-client.iml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 1303507..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,20 +0,0 @@ - -# Javascript Node CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-javascript/ for more details -# -version: 2 -jobs: - build: - docker: - # specify the version you desire here - - image: circleci/node:8.12.0 - - # Specify service dependencies here if necessary - # CircleCI maintains a library of pre-built images - # documented at https://circleci.com/docs/2.0/circleci-images/ - - steps: - - checkout - - run: npm install - - run: npm test diff --git a/.gitignore b/.gitignore index 9429f0c..a9c57ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - +/.circleci /.idea # dependencies /node_modules diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index c6cc8c8..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/masa-review-client.iml b/.idea/masa-review-client.iml deleted file mode 100644 index 24643cc..0000000 --- a/.idea/masa-review-client.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 24eb271..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index b9afeb8..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index cad74fa..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,318 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - DEFINITION_ORDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -