Instantly share code, notes, and snippets.
michaelmang/TileButtons.js Secret
Created
June 28, 2017 02:49
Star
You must be signed in to star a gist
TileButtons.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | |
borderStyle: "solid" | |
}} | |
> | |
<VrButton onClick={ () => this.props.updateStage(1) }> | |
<Image | |
source={{uri: this.props.previews[0]}} | |
style= | |
{{ | |
width: 1, | |
height: 0.6, | |
borderWidth: this.props.borderWidths[0], | |
borderColor: "#A482DF" | |
}} | |
/> | |
</VrButton> | |
</View> | |
<View | |
style={{ | |
margin: 0.1, | |
height: 0.6, | |
backgroundColor: "#CAB9E5", | |
borderStyle: "solid" | |
}} | |
> | |
<VrButton onClick={ () => this.props.updateStage(2) }> | |
<Image | |
source={{uri: this.props.previews[1]}} | |
style= | |
{{ | |
width: 1, | |
height: 0.6, | |
borderWidth: this.props.borderWidths[1], | |
borderColor: "#A482DF" | |
}} | |
/> | |
</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", | |
borderStyle: "solid" | |
}} | |
> | |
<VrButton onClick={ () => this.props.updateStage(3) }> | |
<Image | |
source={{uri: this.props.previews[2]}} | |
style= | |
{{ | |
width: 1, | |
height: 0.6, | |
borderWidth: this.props.borderWidths[2], | |
borderColor: "#A482DF" | |
}} | |
/> | |
</VrButton> | |
</View> | |
<View | |
style={{ | |
margin: 0.1, | |
height: 0.6, | |
backgroundColor: "#CAB9E5", | |
borderStyle: "solid" | |
}} | |
> | |
<VrButton onClick={ () => this.props.updateStage(4) }> | |
<Image | |
source={{uri: this.props.previews[3]}} | |
style= | |
{{ | |
width: 1, | |
height: 0.6, | |
borderWidth: this.props.borderWidths[3], | |
borderColor: "#A482DF" | |
}} | |
/> | |
</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", | |
borderStyle: "solid" | |
}} | |
> | |
<VrButton onClick={ () => this.props.updateStage(5) }> | |
<Image | |
source={{uri: this.props.previews[4]}} | |
style= | |
{{ | |
width: 1, | |
height: 0.6, | |
borderWidth: this.props.borderWidths[4], | |
borderColor: "#A482DF" | |
}} | |
/> | |
</VrButton> | |
</View> | |
<View | |
style={{ | |
margin: 0.1, | |
height: 0.6, | |
backgroundColor: "#CAB9E5", | |
borderStyle: "solid" | |
}} | |
> | |
<VrButton onClick={ () => this.props.updateStage(6) }> | |
<Image | |
source={{uri: this.props.previews[5]}} | |
style= | |
{{ | |
width: 1, | |
height: 0.6, | |
borderWidth: this.props.borderWidths[5], | |
borderColor: "#A482DF" | |
}} | |
/> | |
</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