-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.jsx
40 lines (36 loc) · 1012 Bytes
/
index.jsx
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
import { STATIONS } from "../common/globals.js"
console.log("Opening Tisseo Settings page");
let autoValues = [];
for (let key in STATIONS) {
autoValues.push( {
"name": STATIONS[key],
"value": { code: key, direction: "n" }
} );
}
function mySettings(props) {
return (
<Page>
<Section
title={<Text bold align="center">Tisseo Schedule</Text>}>
<AdditiveList
title="Select your favorite stations"
settingsKey="favorite_station_setting"
maxItems="5"
addAction={
<TextInput
title="Add a Tisseo Station"
label="Name"
placeholder="Type something"
action="Add Station"
onAutocomplete={(value) => {
return autoValues.filter((option) =>
option.name.toLowerCase().startsWith(value.toLowerCase()));
}}
/>
}
/>
</Section>
</Page>
);
}
registerSettingsPage(mySettings);