Update mobile login page
This commit is contained in:
12
mobile/src/app.js
Normal file
12
mobile/src/app.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Platform } from 'react-native'
|
||||
import { Navigation } from 'react-native-navigation'
|
||||
import { registerScreens } from './screens'
|
||||
|
||||
registerScreens()
|
||||
|
||||
Navigation.startSingleScreenApp({
|
||||
screen: {
|
||||
screen: 'app.Home',
|
||||
title: 'Home',
|
||||
}
|
||||
})
|
||||
44
mobile/src/screens/Home.js
Normal file
44
mobile/src/screens/Home.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import React from 'react';
|
||||
import { StyleSheet, Text, View } from 'react-native';
|
||||
|
||||
export class Home extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.props.navigator.setOnNavigatorEvent(this.onNavigatorEvent.bind(this));
|
||||
}
|
||||
|
||||
onNavigatorEvent(event) {
|
||||
switch(event.id) {
|
||||
case 'willAppear':
|
||||
break;
|
||||
case 'didAppear':
|
||||
this.props.navigator.showModal({ screen: 'app.Login' })
|
||||
break;
|
||||
case 'willDisappear':
|
||||
break;
|
||||
case 'didDisappear':
|
||||
break;
|
||||
case 'willCommitPreview':
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text>Hello John</Text>
|
||||
<Text>Changes you make will automatically reload.</Text>
|
||||
<Text>Shake your phone to open the developer menu.</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: '#fff',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
});
|
||||
36
mobile/src/screens/Login.js
Normal file
36
mobile/src/screens/Login.js
Normal file
@@ -0,0 +1,36 @@
|
||||
import React from 'react';
|
||||
import { StyleSheet, Text, Image, Switch, TextInput, View, Button } from 'react-native';
|
||||
import logoImage from './images/deighton.png'
|
||||
|
||||
export class Login extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
handleLogin() {
|
||||
this.props.navigator.dismissModal()
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Image source={logoImage} />
|
||||
<Text>Email:</Text>
|
||||
<TextInput />
|
||||
<Text>Password:</Text>
|
||||
<TextInput />
|
||||
<Switch /><Text>Remember Me</Text>
|
||||
<Button title='Login' onPress={this.handleLogin.bind(this)} />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: '#00ff00',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
});
|
||||
BIN
mobile/src/screens/images/deighton.png
Normal file
BIN
mobile/src/screens/images/deighton.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
8
mobile/src/screens/index.js
Normal file
8
mobile/src/screens/index.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import { Home } from './Home'
|
||||
import { Login } from './Login'
|
||||
import { Navigation } from 'react-native-navigation'
|
||||
|
||||
export function registerScreens() {
|
||||
Navigation.registerComponent('app.Home', () => Home)
|
||||
Navigation.registerComponent('app.Login', () => Login)
|
||||
}
|
||||
Reference in New Issue
Block a user