From 0cec915218b8186ddeb6ff358aecf3c3587288b3 Mon Sep 17 00:00:00 2001 From: Drew Larson Date: Sun, 1 Jan 2017 21:23:50 -0600 Subject: [PATCH] Linting. --- .../assets/js/components/SignIn.jsx | 74 ++++++++++--------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/bikeshop_project/assets/js/components/SignIn.jsx b/bikeshop_project/assets/js/components/SignIn.jsx index 71bf00f..bb80690 100644 --- a/bikeshop_project/assets/js/components/SignIn.jsx +++ b/bikeshop_project/assets/js/components/SignIn.jsx @@ -1,10 +1,11 @@ import fetch from 'isomorphic-fetch'; import moment from 'moment'; -import React from 'react'; -import RaisedButton from 'material-ui/RaisedButton'; import { polyFill } from 'es6-promise'; -import Purpose from './Purpose'; +import RaisedButton from 'material-ui/RaisedButton'; +import React from 'react'; + import Member from './Member'; +import Purpose from './Purpose'; import SignedInList from './SignedInList'; export default class SignIn extends React.Component { @@ -40,26 +41,15 @@ export default class SignIn extends React.Component { }); } - handleUpdate(text, dataSource) { - const self = this; - self.setState({ searchText: text }); - fetch(`/members/search/${text}/`) - .then((response) => { - if (response.status === 200) { - return response.json(); - } - }) - .then((data) => { - if (data.results.length > 0) { - self.setState({ - ...this.state, - error: '', - members: data.results.map(result => ({ text: `${result.name}`, value: `${result.name} <${result.email}>`, id: result.id })), - }); - } else { - self.setState({ ...this.state, error: 'Member not found.' }); - } - }); + chooseMember(chosenRequest, index) { + const member = this.state.members[index]; + const purpose = this.state.signOn.purpose; + + this.setState({ ...this.state, signOn: { member, purpose } }); + } + + onUpdateSearchText(searchText) { + this.setState({ searchText }); } signIn() { @@ -96,21 +86,32 @@ export default class SignIn extends React.Component { } } - chooseMember(chosenRequest, index) { - const member = this.state.members[index]; - const purpose = this.state.signOn.purpose; - - this.setState({ ...this.state, signOn: { member, purpose } }); - } - - onUpdateSearchText(searchText) { - this.setState({ searchText }); - } - handlePurposeChoice(event, index, value) { this.setState({ ...this.state, signOn: { ...this.state.signOn, purpose: value } }); } + handleUpdate(text, dataSource) { + const self = this; + self.setState({ searchText: text }); + fetch(`/members/search/${text}/`) + .then((response) => { + if (response.status === 200) { + return response.json(); + } + }) + .then((data) => { + if (data.results.length > 0) { + self.setState({ + ...this.state, + error: '', + members: data.results.map(result => ({ text: `${result.name}`, value: `${result.name} <${result.email}>`, id: result.id })), + }); + } else { + self.setState({ ...this.state, error: 'Member not found.' }); + } + }); + } + render() { return (
@@ -132,7 +133,10 @@ export default class SignIn extends React.Component { />
- +