Skip to content

Commit

Permalink
Add prettier yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
xuale committed Apr 12, 2018
1 parent 7559582 commit 2c32497
Show file tree
Hide file tree
Showing 5 changed files with 365 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"trailingCommas": "es5",
"trailingComma": "es5"
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"enzyme-adapter-react-16": "^1.1.1",
"husky": "^0.14.3",
"lint-staged": "^7.0.0",
"prettier": "^1.11.0",
"prettier": "^1.11.1",
"prettierrc": "^0.0.0-5",
"react-scripts": "^1.0.17",
"react-test-renderer": "^16.3.1"
},
Expand Down
8 changes: 4 additions & 4 deletions src/actions/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ const LoginUser = token => {
method: "POST",
headers: { "Content-Type": "application/json" },
credentials: "include",
body: JSON.stringify(token)
body: JSON.stringify(token),
});
const status = response.status;
const data = await response.json();
const err = status >= 200 && status < 300;
return { err, data };
} catch (e) {
return {
err: e.message
err: e.message,
};
}
};
Expand All @@ -28,15 +28,15 @@ const RegisterCar = car => {
method: "POST",
headers: { "Content-Type": "application/json" },
credentials: "include",
body: JSON.stringify(car)
body: JSON.stringify(car),
});
const status = response.status;
const data = await response.json();
const err = status >= 200 && status < 300;
return { err, data };
} catch (e) {
return {
err: e.message
err: e.message,
};
}
};
Expand Down
12 changes: 6 additions & 6 deletions src/containers/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class Register extends React.Component {
make: "",
model: "",
year: "",
color: ""
color: "",
},
err: false
err: false,
};

this.login = this.login.bind(this);
Expand All @@ -38,7 +38,7 @@ class Register extends React.Component {
this.setState({
err: false,
login: false,
register_car: true
register_car: true,
});
}

Expand All @@ -51,7 +51,7 @@ class Register extends React.Component {
await this.setState({
err: false,
login: false,
register_car: false
register_car: false,
});
this.props.changePage("/dashboard");
}
Expand Down Expand Up @@ -137,14 +137,14 @@ class Register extends React.Component {

const mapStateToProps = state => {
return {
...state.user
...state.user,
};
};

const mapDispatchToProps = dispatch => {
return {
login: async token => await dispatch(LoginUser(token)),
registerCar: async car => await dispatch(RegisterCar(car))
registerCar: async car => await dispatch(RegisterCar(car)),
};
};

Expand Down
Loading

0 comments on commit 2c32497

Please sign in to comment.