Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
PR Grumbles
Browse files Browse the repository at this point in the history
  • Loading branch information
ngotchac committed Jan 12, 2017
1 parent c2c57a8 commit 74dc32d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
3 changes: 1 addition & 2 deletions js/src/modals/CreateAccount/NewAccount/newAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { IconButton } from 'material-ui';
import { RadioButton, RadioButtonGroup } from 'material-ui/RadioButton';
import ActionAutorenew from 'material-ui/svg-icons/action/autorenew';

import { Form, Input, IdentityIcon, PasswordStrength } from '~/ui';
import { Form, Input, IdentityIcon } from '~/ui';

import ERRORS from '../errors';

Expand Down Expand Up @@ -90,7 +90,6 @@ export default class CreateAccount extends Component {
onChange={ this.onEditPassword2 } />
</div>
</div>
<PasswordStrength input={ password1 } />
{ this.renderIdentitySelector() }
{ this.renderIdentities() }
</Form>
Expand Down
3 changes: 1 addition & 2 deletions js/src/modals/CreateAccount/RawKey/rawKey.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import React, { Component, PropTypes } from 'react';

import { Form, Input, PasswordStrength } from '~/ui';
import { Form, Input } from '~/ui';

import styles from '../createAccount.css';

Expand Down Expand Up @@ -92,7 +92,6 @@ export default class RawKey extends Component {
onChange={ this.onEditPassword2 } />
</div>
</div>
<PasswordStrength input={ password1 } />
</Form>
);
}
Expand Down
3 changes: 1 addition & 2 deletions js/src/modals/CreateAccount/RecoveryPhrase/recoveryPhrase.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import React, { Component, PropTypes } from 'react';
import { Checkbox } from 'material-ui';

import { Form, Input, PasswordStrength } from '~/ui';
import { Form, Input } from '~/ui';

import styles from '../createAccount.css';

Expand Down Expand Up @@ -89,7 +89,6 @@ export default class RecoveryPhrase extends Component {
onChange={ this.onEditPassword2 } />
</div>
</div>
<PasswordStrength input={ password1 } />
<Checkbox
className={ styles.checkbox }
label='Key was created with Parity <1.4.5 on Windows'
Expand Down
10 changes: 3 additions & 7 deletions js/src/ui/Form/PasswordStrength/passwordStrength.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const BAR_STYLE = {
};

export default class PasswordStrength extends Component {

static propTypes = {
input: PropTypes.string.isRequired
};
Expand All @@ -41,7 +40,7 @@ export default class PasswordStrength extends Component {
constructor (props) {
super(props);

this.updateStrength = debounce(this._updateStrength, 500, { leading: true });
this.updateStrength = debounce(this._updateStrength, 50, { leading: true });
}

componentWillMount () {
Expand Down Expand Up @@ -76,7 +75,7 @@ export default class PasswordStrength extends Component {
<div className={ styles.strength }>
<label className={ styles.label }>
<FormattedMessage
id='passwordStrength.label'
id='ui.passwordStrength.label'
defaultMessage='password strength'
/>
</label>
Expand All @@ -96,14 +95,12 @@ export default class PasswordStrength extends Component {
// Note that the suggestions are in english, thus it wouldn't
// make sense to add translations to surrounding words
renderFeedback (feedback = {}) {
const { crack_times_display } = this.state.strength;
const { suggestions = [] } = feedback;

return (
<div>
<p>
It would take { crack_times_display.offline_slow_hashing_1e4_per_second } to crack this password.
&nbsp;{ suggestions.join(' ') }
{ suggestions.join(' ') }
</p>
</div>
);
Expand All @@ -122,7 +119,6 @@ export default class PasswordStrength extends Component {
return 'orange';

default:
case 0:
return 'red';
}
}
Expand Down
3 changes: 3 additions & 0 deletions js/src/ui/Form/PasswordStrength/passwordStrength.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ describe('ui/Form/PasswordStrength', () => {
describe('rendering', () => {
it('renders', () => {
expect(render({ input: INPUT_A })).to.be.ok;
});

it('renders a linear progress', () => {
expect(render({ input: INPUT_A }).find('LinearProgress')).to.be.ok;
});

Expand Down

0 comments on commit 74dc32d

Please sign in to comment.