Files
drip/components/settings/password/create.js
T
2020-08-22 13:05:17 +02:00

41 lines
950 B
JavaScript

import React, { Component } from 'react'
import Button from '../../common/button'
import EnterNewPassword from './enter-new-password'
import showBackUpReminder from './show-backup-reminder'
import settings from '../../../i18n/en/settings'
export default class CreatePassword extends Component {
constructor() {
super()
this.state = { isSettingPassword: false }
}
toggleSettingPassword = () => {
const { isSettingPassword } = this.state
this.setState({ isSettingPassword: !isSettingPassword })
}
startSettingPassword = () => {
showBackUpReminder(this.toggleSettingPassword, () => {})
}
render () {
const { isSettingPassword } = this.state
const labels = settings.passwordSettings
if (!isSettingPassword) {
return (
<Button isCTA onPress={this.startSettingPassword}>
{labels.setPassword}
</Button>
)
} else {
return <EnterNewPassword />
}
}
}