Introduces password management section redesign

This commit is contained in:
mashazyu
2020-03-25 16:26:57 +01:00
committed by Sofiya Tepikin
parent 842e8a2a24
commit a68ec248b0
6 changed files with 108 additions and 125 deletions
+15 -13
View File
@@ -1,18 +1,20 @@
import React, { Component } from 'react'
import { ScrollView } from 'react-native'
import AppPage from '../../common/app-page'
import AppText from '../../common/app-text'
import Segment from '../../common/segment'
import CreatePassword from './create'
import ChangePassword from './update'
import DeletePassword from './delete'
import Segment from '../../common/segment'
import AppText from '../../common/app-text'
import {
hasEncryptionObservable
} from '../../../local-storage'
import { hasEncryptionObservable } from '../../../local-storage'
import labels from '../../../i18n/en/settings'
export default class PasswordSetting extends Component {
constructor(props) {
super(props)
this.state = {
isPasswordSet: hasEncryptionObservable.value,
isChangingPassword: false,
@@ -51,29 +53,29 @@ export default class PasswordSetting extends Component {
} = labels.passwordSettings
return (
<ScrollView>
<Segment title={title}>
<AppPage>
<Segment title={title} last>
<AppText>
{ isPasswordSet ? explainerEnabled : explainerDisabled }
{isPasswordSet ? explainerEnabled : explainerDisabled}
</AppText>
{ !isPasswordSet && <CreatePassword/> }
{!isPasswordSet && <CreatePassword/>}
{ (isPasswordSet && !isDeletingPassword) && (
{(isPasswordSet && !isDeletingPassword) && (
<ChangePassword
onStartChange = {this.onChangingPassword}
onCancelChange = {this.onCancelChangingPassword}
/>
)}
{ (isPasswordSet && !isChangingPassword) && (
{(isPasswordSet && !isChangingPassword) && (
<DeletePassword
onStartDelete = {this.onDeletingPassword}
onCancelDelete = {this.onCancelDeletingPassword}
/>
)}
</Segment>
</ScrollView>
</AppPage>
)
}
}