|
@ -84,9 +84,11 @@ class InputPassword extends PureComponent<Props, State> { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
render() { |
|
|
render() { |
|
|
const { t, maxLength } = this.props |
|
|
const { t, value, maxLength } = this.props |
|
|
const { passwordStrength, inputType } = this.state |
|
|
const { passwordStrength, inputType } = this.state |
|
|
|
|
|
|
|
|
|
|
|
const hasValue = value.trim() !== '' |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<Box flow={1}> |
|
|
<Box flow={1}> |
|
|
<Input |
|
|
<Input |
|
@ -101,11 +103,15 @@ class InputPassword extends PureComponent<Props, State> { |
|
|
} |
|
|
} |
|
|
/> |
|
|
/> |
|
|
<Box flow={1} horizontal> |
|
|
<Box flow={1} horizontal> |
|
|
{[1, 2, 3, 4].map(v => ( |
|
|
{[0, 1, 2, 3, 4].map(v => ( |
|
|
<Strength key={v} warning={passwordStrength <= 1} activated={passwordStrength >= v} /> |
|
|
<Strength |
|
|
|
|
|
key={v} |
|
|
|
|
|
warning={passwordStrength <= 1} |
|
|
|
|
|
activated={hasValue && passwordStrength >= v} |
|
|
|
|
|
/> |
|
|
))} |
|
|
))} |
|
|
</Box> |
|
|
</Box> |
|
|
{passwordStrength > 0 && ( |
|
|
{hasValue && ( |
|
|
<Warning passwordStrength={passwordStrength}> |
|
|
<Warning passwordStrength={passwordStrength}> |
|
|
{t(`password:warning_${passwordStrength}`)} |
|
|
{t(`password:warning_${passwordStrength}`)} |
|
|
</Warning> |
|
|
</Warning> |
|
|