Added Header, Icon and MessageModal. Refactor screens into directories.

This commit is contained in:
John Lyon-Smith
2018-04-02 13:22:33 -07:00
parent aa622012cd
commit 410d2fde4f
56 changed files with 556 additions and 461 deletions

View File

@@ -0,0 +1,73 @@
import React from 'react'
import { StyleSheet, View } from 'react-native'
import {
ViroARSceneNavigator, ViroARScene, ViroARPlane, ViroBox, ViroText, ViroAmbientLight
} from 'react-viro'
import autobind from 'autobind-decorator'
import backImage from './images/back.png'
const styles = {
helloWorldTextStyle: {
fontFamily: 'Arial',
fontSize: 30,
color: '#ffffff',
textAlignVertical: 'center',
textAlign: 'center',
},
buttons : {
height: 80,
width: 80,
},
}
class WorkItemSceneAR extends React.Component {
constructor(props) {
super(props)
this.state = {
text : "Initializing AR..."
}
}
render() {
return (
<ViroARScene onTrackingInitialized={()=>{this.setState({text : "Hello World!"})}}>
<ViroAmbientLight color="#ffffff" intensity={200}/>
<ViroText
text={this.state.text} scale={[.5, .5, .5]}
position={[0, 0, -1]}
style={styles.helloWorldTextStyle} />
<ViroARPlane>
<ViroBox position={[0, .5, 0]} />
</ViroARPlane>
</ViroARScene>
)
}
}
export class ARViewer extends React.Component {
constructor(props) {
super(props)
}
@autobind
_handlePress() {
this.props.history.replace('/')
}
render() {
return (
<View style={{ width: '100%', height: '100%' }} >
<ViroARSceneNavigator
style={{ width: '100%', height: '100%' }}
apiKey='06F37B6A-74DA-4A83-965A-7DE2209A5C46'
initialScene={{ scene: WorkItemSceneAR }} />
<View style={{position: 'absolute', left: 50, right: 0, top: 50}}>
<TouchableHighlight style={styles.buttons} onPress={this._handlePress} underlayColor={'#00000000'} >
<Image source={backImage} />
</TouchableHighlight>
</View>
</View>
)
}
}