-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
99 lines (92 loc) · 3.63 KB
/
App.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import React from 'react';
import SeatsioSeatingChart from "./src/SeatsioSeatingChart";
import {StyleSheet, View, Button} from 'react-native';
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
colorScheme: 'light'
}
}
styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: "column",
},
chart: {
flex: 0.5,
marginTop: 100
},
buttons: {
flex: 0.5,
backgroundColor: "#EEE"
}
});
toggleColorScheme() {
if (this.state.colorScheme === 'light') {
this.setState({colorScheme: 'dark'})
} else {
this.setState({colorScheme: 'light'})
}
}
render() {
return (
<View style={this.styles.container}>
<View style={this.styles.chart}>
<SeatsioSeatingChart
workspaceKey="publicDemoKey"
event={"largeTheatreEvent"}
onChartRendered={chart => console.log(chart)}
pricing={[
{'category': 1, 'price': 120},
{'category': 2, 'price': 20},
{'category': 3, 'price': 50}
]}
priceFormatter={price => '$ ' + price}
// numberOfPlacesToSelect={2}
// selectedObjects={['A-8']}
// session={"continue"}
colorScheme={this.state.colorScheme}
tooltipInfo={object => "[b]This[/b] object's [i]id[/i] is [pre]" + object.label + "[/pre]"}
objectTooltip={{
showActionHint: true,
showAvailability: false,
showCategory: true,
showLabel: true,
showPricing: true,
showUnavailableNotice: true,
stylizedLabel: true,
confirmSelectionOnMobile: "auto"
}}
language={"fr"}
messages={{
'ORGAN': 'Hello World!'
}}
maxSelectedObjects={3}
// objectColor={(obj, defaultColor, extraConfig) => defaultColor}
// objectLabel={(object, defaultLabel, extraConfig) => 'abc'}
// objectIcon={(object, defaultIcon, extraConfig) => 'bullseye'}
isObjectVisible={(object, extraConfig) => true}
showRowLabels={false}
showLegend={true}
legend={{
hideCategoryName: true
}}
showActiveSectionTooltipOnMobile={true}
objectCategory={(object, categories, defaultCategory, extraConfig) => {
return categories.get('Stalls');
}}
inputDevice={"auto"}
loading={"<div class='loader'>Loading...</div>"}
/>
</View>
<View style={this.styles.buttons}>
<Button
title="Toggle color scheme"
onPress={this.toggleColorScheme.bind(this)}
/>
</View>
</View>
)
}
}