Commit test viewer screen
This commit is contained in:
@@ -12,14 +12,14 @@ export class Home extends React.Component {
|
|||||||
static navigatorButtons = {
|
static navigatorButtons = {
|
||||||
rightButtons: [
|
rightButtons: [
|
||||||
{
|
{
|
||||||
|
id: 'viewer',
|
||||||
icon: require('./images/ar-glases.png'),
|
icon: require('./images/ar-glases.png'),
|
||||||
id: 'arview',
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
leftButtons: [
|
leftButtons: [
|
||||||
{
|
{
|
||||||
icon: require('./images/logout.png'),
|
|
||||||
id: 'logout',
|
id: 'logout',
|
||||||
|
icon: require('./images/logout.png'),
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -55,13 +55,20 @@ export class Home extends React.Component {
|
|||||||
api.logout().then(() => {
|
api.logout().then(() => {
|
||||||
this.props.navigator.showModal({ screen: 'app.Login' })
|
this.props.navigator.showModal({ screen: 'app.Login' })
|
||||||
})
|
})
|
||||||
|
break
|
||||||
|
case 'viewer':
|
||||||
|
this.props.navigator.push({
|
||||||
|
screen: 'app.Viewer',
|
||||||
|
animation: 'slide-horizontal',
|
||||||
|
})
|
||||||
|
break
|
||||||
case 'willAppear':
|
case 'willAppear':
|
||||||
break
|
break
|
||||||
case 'didAppear':
|
case 'didAppear':
|
||||||
if (!api.loggedInUser) {
|
if (!api.loggedInUser) {
|
||||||
this.props.navigator.showModal({ screen: 'app.Login' })
|
this.props.navigator.showModal({ screen: 'app.Login' })
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
case 'willDisappear':
|
case 'willDisappear':
|
||||||
break
|
break
|
||||||
case 'didDisappear':
|
case 'didDisappear':
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { StyleSheet, View, TouchableOpacity, Image } from 'react-native'
|
||||||
|
import backImage from './images/back.png'
|
||||||
|
|
||||||
|
export class Viewer extends React.Component {
|
||||||
|
static navigatorStyle = {
|
||||||
|
navBarHidden: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
static styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
height: '100%',
|
||||||
|
width: '100%',
|
||||||
|
justifyContent: 'flex-start',
|
||||||
|
backgroundColor: '#AAAAAA',
|
||||||
|
},
|
||||||
|
button: {
|
||||||
|
marginTop: 40,
|
||||||
|
marginLeft: 20,
|
||||||
|
width: 45,
|
||||||
|
height: 45,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props)
|
||||||
|
this._handlePressButton = this._handlePressButton.bind(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
_handlePressButton() {
|
||||||
|
this.props.navigator.pop()
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<View style={Viewer.styles.container}>
|
||||||
|
<TouchableOpacity onPress={this._handlePressButton}>
|
||||||
|
<Image style={Viewer.styles.button} source={backImage} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
BIN
mobile/src/screens/images/back.png
Normal file
BIN
mobile/src/screens/images/back.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
@@ -1,7 +1,7 @@
|
|||||||
import { Home } from './Home'
|
import { Home } from './Home'
|
||||||
import { Login } from './Login'
|
import { Login } from './Login'
|
||||||
import { Error } from './Error'
|
import { Error } from './Error'
|
||||||
import { View } from './Viewer'
|
import { Viewer } from './Viewer'
|
||||||
import { Navigation } from 'react-native-navigation'
|
import { Navigation } from 'react-native-navigation'
|
||||||
|
|
||||||
export function registerScreens() {
|
export function registerScreens() {
|
||||||
|
|||||||
Reference in New Issue
Block a user