-
Notifications
You must be signed in to change notification settings - Fork 60
Add option to remember account for read-only access - Closes #559 #737
Conversation
... with visibility toggle
... and remove duplicate tests from Login component
Warning: `value` prop on `input` should not be null. Consider using the empty string to clear the component or `undefined` for uncontrolled components.
2726726
to
32e4f15
Compare
... in read-only mode
to indicate if passphrase will be required
import styles from './account.css'; | ||
|
||
const getStatusTooltip = (props) => { | ||
if (props.secondSignature) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the condition statement is long, sometimes the combination of ternary and if-else blocks helps keep the code readable, but in simple conditions please prefer a single type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Good point
error={this.props.secondPassphrase.error} | ||
value={this.props.secondPassphrase.value} | ||
onChange={this.onChange.bind(this, 'secondPassphrase')} /> : | ||
null)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
error={this.props.passphrase.error} | ||
value={this.props.passphrase.value} | ||
onChange={this.onChange.bind(this, 'passphrase')} /> : | ||
null)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ conditionStatement && <Component /> }
equivalents and also helps eliminate the tailing null
.
<TooltipIconButton className={`show-passphrase-toggle ${styles.eyeIcon}`} | ||
tooltipPosition='horizontal' | ||
tooltip={this.state.inputType === 'password' ? 'Show passphrase' : 'Hide passphrase'} | ||
icon='remove_red_eye' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace the icon name string value with:
{ this.state.inputType === 'password' ? 'visibility' : 'visibility_off' }
|
||
render() { | ||
return (getSavedAccount() ? | ||
<MenuItem caption="Forget this account locally" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe Forget this account? since we don't use the words remove or delete, adding the adverb locally may create confusion. (This is just a suggestion)
className='forget-account' | ||
onClick={this.removeSavedAccount.bind(this)} | ||
/> : | ||
<MenuItem caption="Save this account locally" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the more common sentence for this concept is Remember this account.
export default class SaveAccountButton extends React.Component { | ||
removeSavedAccount() { | ||
removeSavedAccount(); | ||
this.props.successToast({ label: 'Account forgotten locally.' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully forgot this account?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Vit. Excellent!
Closes #559