Files
drip/components/app-wrapper.js
T
2018-09-16 11:47:33 +02:00

26 lines
592 B
JavaScript

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>
)
}
}