Skip to content

Instantly share code, notes, and snippets.

@michaelmang
Created June 28, 2017 02:32
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save michaelmang/8e360f0a8e279b74e053ee8b5f452803 to your computer and use it in GitHub Desktop.
TitleButton.js
import React from 'react';
import {
Text,
View,
VrButton,
Image
} from 'react-vr';
//Element
class TileButtons extends React.Component {
render() {
return (
<View style={{marginTop: -0.09, flexDirection: 'row', alignItems: 'center', justifyContent: 'center'}}>
<View style={{ margin: 0.1, width: 1, flexDirection: 'column', alignItems: 'center', justifyContent: 'center'}}>
<View
style={{
margin: 0.1,
height: 0.6,
backgroundColor: "#CAB9E5",
borderWidth: this.props.borderWidths[0],
borderColor: "#A482DF",
borderStyle: "solid"
}}
>
<VrButton onClick={ () => this.props.updateStage(1) }>
<Image source={{uri: this.props.previews[0]}} style={{width: 1, height: 0.6}}/>
</VrButton>
</View>
<View
style={{
margin: 0.1,
height: 0.6,
backgroundColor: "#CAB9E5",
borderWidth: this.props.borderWidths[1],
borderColor: "#A482DF",
borderStyle: "solid"
}}
>
<VrButton onClick={ () => this.props.updateStage(2) }>
<Image source={{uri: this.props.previews[1]}} style={{width: 1, height: 0.6}}/>
</VrButton>
</View>
</View>
<View style={{ margin: 0.1, width: 1, flexDirection: 'column', alignItems: 'center', justifyContent: 'center'}}>
<View
style={{
margin: 0.1,
height: 0.6,
backgroundColor: "#CAB9E5",
borderWidth: this.props.borderWidths[2],
borderColor: "#A482DF",
borderStyle: "solid"
}}
>
<VrButton onClick={ () => this.props.updateStage(3) }>
<Image source={{uri: this.props.previews[2]}} style={{width: 1, height: 0.6}}/>
</VrButton>
</View>
<View
style={{
margin: 0.1,
height: 0.6,
backgroundColor: "#CAB9E5",
borderWidth: this.props.borderWidths[3],
borderColor: "#A482DF",
borderStyle: "solid"
}}
>
<VrButton onClick={ () => this.props.updateStage(4) }>
<Image source={{uri: this.props.previews[3]}} style={{width: 1, height: 0.6}}/>
</VrButton>
</View>
</View>
<View style={{ margin: 0.1, width: 1, flexDirection: 'column', alignItems: 'center', justifyContent: 'center'}}>
<View
style={{
margin: 0.1,
height: 0.6,
backgroundColor: "#CAB9E5",
borderWidth: this.props.borderWidths[4],
borderColor: "#A482DF",
borderStyle: "solid"
}}
>
<VrButton onClick={ () => this.props.updateStage(5) }>
<Image source={{uri: this.props.previews[4]}} style={{width: 1, height: 0.6}}/>
</VrButton>
</View>
<View
style={{
margin: 0.1,
height: 0.6,
backgroundColor: "#CAB9E5",
borderWidth: this.props.borderWidths[5],
borderColor: "#A482DF",
borderStyle: "solid"
}}
>
<VrButton onClick={ () => this.props.updateStage(6) }>
<Image source={{uri: this.props.previews[5]}} style={{width: 1, height: 0.6}}/>
</VrButton>
</View>
</View>
</View>
)
}
}
module.exports = TileButtons;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment