-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.vr.js
78 lines (74 loc) · 1.76 KB
/
index.vr.js
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import React from 'react';
import { AppRegistry, asset, Pano, Text, View } from 'react-vr';
import { Route, MemoryRouter } from 'react-router';
import Dropdown from './src/components/Dropdown';
import Chart from './src/components/Chart';
import Link from './src/components/Link';
import WobblyShape from './src/components/WobblyShape';
const ITEMS = ['donuts', 'pizza', 'kale', 'carrots'];
const DATA = [
{
x: 1,
y: 10,
},
{
x: 2,
y: 5,
},
{
x: 3,
y: 2,
},
{
x: 4,
y: 15,
},
{
x: 5,
y: 1,
},
];
export default function Journey() {
return (
<MemoryRouter>
<View>
<Pano source={asset('chess-world.jpg')} />
<Link to="/downshift" rotateY={-90}>
Dropdown
</Link>
<Link to="/victory" rotateY={90}>
Graphing
</Link>
<Link to="/animated" rotateY={180}>
Animated
</Link>
<Route
path="/"
exact
render={() => (
<Text
style={{
position: 'absolute',
layoutOrigin: [0.5, 0.5],
transform: [{ translate: [0, 0, -3] }],
fontSize: 0.4,
textAlign: 'center',
backgroundColor: 'gray',
color: 'white',
}}
>
{'<-- Pick a library -->'}
</Text>
)}
/>
<Route path="/victory" render={() => <Chart data={DATA} />} />
<Route
path="/downshift"
render={() => <Dropdown placeholder="Select an item" items={ITEMS} />}
/>
<Route path="/animated" render={() => <WobblyShape />} />
</View>
</MemoryRouter>
);
}
AppRegistry.registerComponent('Journey', () => Journey);