-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.vr.js
More file actions
61 lines (55 loc) · 1.09 KB
/
Copy pathindex.vr.js
File metadata and controls
61 lines (55 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import React from 'react';
import {
AppRegistry,
View,
} from 'react-vr';
import Canvas from './components/Canvas';
import UI from './components/UI';
const Config = [
{
key: 0,
imageSrc: 'living-room.vr.jpg',
buttonImageSrc: 'living-room.vr.jpg'
},
{
key: 1,
imageSrc: 'church.jpg',
buttonImageSrc: 'church.jpg'
},
{
key: 2,
imageSrc: 'broken-house.jpg',
buttonImageSrc: 'broken-house.jpg'
},
{
key: 3,
imageSrc: 'chess-world.jpg',
buttonImageSrc: 'chess-world.jpg'
},
{
key: 4,
imageSrc: 'medieval-place.jpg',
buttonImageSrc: 'medieval-place.jpg'
}
];
export default class react_vr_ios extends React.Component {
constructor() {
super();
this.state = {
src: 'living-room.vr.jpg'
}
}
render() {
return (
<View>
<Canvas src={this.state.src} />
<UI
buttonConfig={Config}
onClick={(key) => {
this.setState({src: Config[key].imageSrc})
}} />
</View>
);
}
};
AppRegistry.registerComponent('react_vr_ios', () => react_vr_ios);