You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
2.0 KiB
62 lines
2.0 KiB
7 years ago
|
import React from 'react'
|
||
|
import PropTypes from 'prop-types'
|
||
|
import styles from './NewWalletPassword.scss'
|
||
|
|
||
7 years ago
|
const NewWalletPassword = ({
|
||
|
createWalletPassword,
|
||
|
createWalletPasswordConfirmation,
|
||
|
showCreateWalletPasswordConfirmationError,
|
||
7 years ago
|
passwordMinCharsError,
|
||
7 years ago
|
updateCreateWalletPassword,
|
||
|
updateCreateWalletPasswordConfirmation
|
||
7 years ago
|
}) => (
|
||
|
<div className={styles.container}>
|
||
|
<section className={styles.input}>
|
||
|
<input
|
||
7 years ago
|
type="password"
|
||
|
placeholder="Password"
|
||
7 years ago
|
className={`${styles.password} ${
|
||
|
showCreateWalletPasswordConfirmationError ? styles.error : undefined
|
||
|
}
|
||
7 years ago
|
${passwordMinCharsError && styles.error}`}
|
||
7 years ago
|
value={createWalletPassword}
|
||
|
onChange={event => updateCreateWalletPassword(event.target.value)}
|
||
|
/>
|
||
|
</section>
|
||
7 years ago
|
|
||
7 years ago
|
<section className={styles.input}>
|
||
|
<input
|
||
7 years ago
|
type="password"
|
||
|
placeholder="Confirm Password"
|
||
7 years ago
|
className={`${styles.password} ${
|
||
|
showCreateWalletPasswordConfirmationError ? styles.error : undefined
|
||
|
}
|
||
7 years ago
|
${passwordMinCharsError && styles.error}`}
|
||
7 years ago
|
value={createWalletPasswordConfirmation}
|
||
|
onChange={event => updateCreateWalletPasswordConfirmation(event.target.value)}
|
||
|
/>
|
||
7 years ago
|
<p
|
||
7 years ago
|
className={`${styles.errorMessage} ${
|
||
|
showCreateWalletPasswordConfirmationError ? styles.visible : undefined
|
||
|
}`}
|
||
7 years ago
|
>
|
||
7 years ago
|
Passwords do not match
|
||
|
</p>
|
||
7 years ago
|
<p className={`${styles.helpMessage} ${passwordMinCharsError ? styles.red : undefined}`}>
|
||
7 years ago
|
Password must be at least 8 characters long
|
||
|
</p>
|
||
7 years ago
|
</section>
|
||
|
</div>
|
||
|
)
|
||
7 years ago
|
|
||
|
NewWalletPassword.propTypes = {
|
||
|
createWalletPassword: PropTypes.string.isRequired,
|
||
7 years ago
|
createWalletPasswordConfirmation: PropTypes.string.isRequired,
|
||
|
showCreateWalletPasswordConfirmationError: PropTypes.bool.isRequired,
|
||
7 years ago
|
passwordMinCharsError: PropTypes.bool.isRequired,
|
||
7 years ago
|
updateCreateWalletPassword: PropTypes.func.isRequired,
|
||
|
updateCreateWalletPasswordConfirmation: PropTypes.func.isRequired
|
||
7 years ago
|
}
|
||
|
|
||
|
export default NewWalletPassword
|