Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
Eslint: react/jsx-indent. Fixed unhandling the changes in Register's …
Browse files Browse the repository at this point in the history
…username field (from outside)
  • Loading branch information
artkravchenko committed May 30, 2016
1 parent 5168f66 commit cc88d59
Show file tree
Hide file tree
Showing 8 changed files with 230 additions and 199 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"react/jsx-curly-spacing": 2,
"react/jsx-equals-spacing": 2,
"react/jsx-first-prop-new-line": [2, "multiline"],
"react/jsx-indent": [2, 2],
"react/jsx-indent-props": [2, 2],
"react/jsx-key": 1,
"react/jsx-no-bind": [2, { "ignoreRefs": true }],
Expand Down
69 changes: 37 additions & 32 deletions src/components/login.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is a part of libertysoil.org website
Copyright (C) 2015 Loki Education (Social Enterprise)
Copyright (C) 2016 Loki Education (Social Enterprise)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
Expand All @@ -14,13 +14,18 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React from 'react';
import { Link } from 'react-router';
*/
import React, { PropTypes } from 'react';
import { Link } from 'react-router';
import ga from 'react-google-analytics';


export default class LoginComponent extends React.Component {
static displayName = 'LoginComponent';

static propTypes = {
onLoginUser: PropTypes.func.isRequired
};

submitHandler = (event) => {
event.preventDefault();

Expand All @@ -33,37 +38,37 @@ export default class LoginComponent extends React.Component {

render() {
return (
<form onSubmit={this.submitHandler} action="" method="post" className="layout__grid layout__grid-responsive layout-align_end layout__space-double">
<div className="layout__grid_item layout__grid_item-identical">
<label className="label label-before_input" htmlFor="loginUsername">User name</label>
<div className="input_group">
<span className="input_group__before input_group__before-outside micon micon-extra">person</span>
<div className="input_group__input">
<input
className="input input-big input-block"
id="loginUsername"
required="required"
type="text"
name="username"
placeholder="Username"
autoCapitalize="none"
autoCorrect="off"
/>
</div>
<form action="" className="layout__grid layout__grid-responsive layout-align_end layout__space-double" method="post" onSubmit={this.submitHandler}>
<div className="layout__grid_item layout__grid_item-identical">
<label className="label label-before_input" htmlFor="loginUsername">User name</label>
<div className="input_group">
<span className="input_group__before input_group__before-outside micon micon-extra">person</span>
<div className="input_group__input">
<input
autoCapitalize="none"
autoCorrect="off"
className="input input-big input-block"
id="loginUsername"
name="username"
placeholder="Username"
required="required"
type="text"
/>
</div>
</div>
<div className="layout__grid_item layout__grid_item-identical">
<label className="label label-before_input" htmlFor="loginPassword">Password</label>
<div className="input_group">
<div className="input_group__input">
<input className="input input-big input-block" id="loginPassword" required="required" type="password" name="password" placeholder="Password" />
</div>
<Link to="/resetpassword" className="link input_group__after input_group__after-outside_bottom">Forgot your password?</Link>
</div>
<div className="layout__grid_item layout__grid_item-identical">
<label className="label label-before_input" htmlFor="loginPassword">Password</label>
<div className="input_group">
<div className="input_group__input">
<input className="input input-big input-block" id="loginPassword" name="password" placeholder="Password" required="required" type="password" />
</div>
<Link className="link input_group__after input_group__after-outside_bottom" to="/resetpassword">Forgot your password?</Link>
</div>
<div className="layout__grid_item">
<button className="button button-big button-red">Log in</button>
</div>
</div>
<div className="layout__grid_item">
<button className="button button-big button-red">Log in</button>
</div>
</form>
);
}
Expand Down
31 changes: 18 additions & 13 deletions src/components/profile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is a part of libertysoil.org website
Copyright (C) 2015 Loki Education (Social Enterprise)
Copyright (C) 2016 Loki Education (Social Enterprise)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
Expand All @@ -14,7 +14,7 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
import React from 'react';
import { Link } from 'react-router';
import { pick } from 'lodash';
Expand Down Expand Up @@ -109,7 +109,7 @@ export default class ProfileHeader extends React.Component {
if (user.more.firstName || user.more.lastName) {
name = `${user.more.firstName} ${user.more.lastName}`;
modalName = [
<span className="font-bold">{name}</span>,
<span className="font-bold" key="modalName">{name}</span>,
` (${user.username})`
];
}
Expand Down Expand Up @@ -177,33 +177,33 @@ export default class ProfileHeader extends React.Component {
name = name.trim();

return (
<div ref={c => this.root = c} className="profile" style={{ backgroundImage: `url('${picture}')` }}>
<div className="profile" ref={c => this.root = c} style={{ backgroundImage: `url('${picture}')` }}>
<div className="profile__body">
<div className="layout__row">
<div className="layout__grid">
<div className="layout__grid_item layout__grid_item-wide">
<User
user={user}
editorConfig={editable ? { flexible: false, onUpdateAvatar: this.addAvatar } : false}
avatarPreview={avatarPreview}
avatarSize="120"
isRound
editorConfig={editable ? { flexible: false, onUpdateAvatar: this.addAvatar } : false}
hideText
isRound
user={user}
/>
</div>
{editable &&
<div className="layout__grid_item layout__grid_item-wide layout-align_right update_picture__container">
<UpdatePicture
what="profile background"
where={modalName}
preview={PROFILE_HEADER_SIZE.PREVIEW}
flexible
limits={{ min: PROFILE_HEADER_SIZE.MIN, max: PROFILE_HEADER_SIZE.BIG }}
preview={PROFILE_HEADER_SIZE.PREVIEW}
what="profile background"
where={modalName}
onSubmit={this.addHeaderPicture}
/>
</div>
}
</div>
}
</div>
</div>
<div className="layout__row">
<div className="layout__grid">
Expand All @@ -218,7 +218,12 @@ export default class ProfileHeader extends React.Component {
{followersCount}
</div>
<div className="layout__grid_item">
<FollowButton active_user={current_user} user={user} following={i_am_following} triggers={this.props.triggers} />
<FollowButton
active_user={current_user}
following={i_am_following}
triggers={this.props.triggers}
user={user}
/>
</div>
</div>
</div>
Expand Down

0 comments on commit cc88d59

Please sign in to comment.