Add wrapper for password screen and logged-in app

This commit is contained in:
Julia Friesel
2018-09-14 09:19:31 +02:00
parent 467dc8d424
commit 6c49d8a36c
3 changed files with 67 additions and 45 deletions
+26
View File
@@ -0,0 +1,26 @@
import React, { Component } from 'react'
import { View } from 'react-native'
import nodejs from 'nodejs-mobile-react-native'
import App from './app'
import PasswordPrompt from './password-prompt'
export default class AppWrapper extends Component {
constructor() {
super()
this.state = {}
nodejs.start('main.js')
}
render() {
return (
<View style={{ flex: 1 }}>
{this.state.showApp ?
<App/>
:
<PasswordPrompt
onCorrectPassword={() => this.setState({showApp: true})}
/>
}
</View>
)
}
}