This commit is contained in:
Julia Friesel
2018-09-14 13:08:11 +02:00
parent 01a1fa4385
commit a74eb40805
4 changed files with 42 additions and 17 deletions
+1 -1
View File
@@ -106,6 +106,6 @@ export const bleedingPrediction = {
}
export const passwordPrompt = {
title: 'Log in',
title: 'Unlock app',
enterPassword: 'Enter password here'
}
+12 -8
View File
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { View, TextInput, TouchableOpacity, Alert } from 'react-native'
import { View, TextInput, TouchableOpacity, Alert, Image } from 'react-native'
import nodejs from 'nodejs-mobile-react-native'
import { AppText } from './app-text'
import { hasEncryptionObservable } from '../local-storage'
@@ -55,33 +55,37 @@ export default class PasswordPrompt extends Component {
render() {
return (
<View style={styles.passwordPrompt}>
<View flex={1}>
{this.state.showPasswordPrompt &&
<View>
<View style={styles.passwordPromptPage}>
<Image
source={require('../assets/drip_small.png')}
style={styles.passwordPromptImage}
/>
<TextInput
onChangeText={val => this.setState({ password: val })}
style={styles.passwordField}
style={styles.passwordPromptField}
secureTextEntry={true}
placeholder={passwordPrompt.enterPassword}
/>
<TouchableOpacity
style={styles.settingsButton}
style={styles.passwordPromptButton}
onPress={() => {
requestHash(this.state.password)
}}
>
<AppText style={styles.settingsButtonText}>
<AppText style={styles.passwordPromptButtonText}>
{passwordPrompt.title}
</AppText>
</TouchableOpacity>
<TouchableOpacity
style={styles.settingsButton}
style={styles.passwordPromptButton}
onPress={async () => {
await deleteDbAndOpenNew()
this.setState({ showApp: true })
}}
>
<AppText style={styles.settingsButtonText}>
<AppText style={styles.passwordPromptButtonText}>
{'Delete old db and make unencrypted new'}
</AppText>
</TouchableOpacity>