This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ git:(master) ✗ node -v | |
v5.2.0 | |
➜ git:(master) ✗ npm -v | |
3.3.12 | |
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade | |
> node-sass@0.9.3 install /node_modules/node-sass | |
> node build.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
createContact = item => { | |
let items = this.state.items; | |
let email = this.state.email; | |
const itemsIncludesEmail = items.some(o => o.email === mail); | |
const emailValid = EmailValidator.validate(email); | |
if (items.length < 10 && !itemsIncludesEmail && emailValid) { | |
this.setState(state => ({ | |
button: true, | |
items: state.items.concat([item]), |