|
@@ -37,7 +37,7 @@ const LIST_ITEM_HEIGHT = 64;
|
37
|
37
|
export type ProxiwashMachineType = {
|
38
|
38
|
number: string,
|
39
|
39
|
state: string,
|
40
|
|
- maxWeight: number,
|
|
40
|
+ 'maxWeight ': number,
|
41
|
41
|
startTime: string,
|
42
|
42
|
endTime: string,
|
43
|
43
|
donePercent: string,
|
|
@@ -128,6 +128,11 @@ class ProxiwashScreen extends React.Component<PropsType, StateType> {
|
128
|
128
|
iconName="information"
|
129
|
129
|
onPress={this.onAboutPress}
|
130
|
130
|
/>
|
|
131
|
+ <Item
|
|
132
|
+ title="settings"
|
|
133
|
+ iconName="settings"
|
|
134
|
+ onPress={this.onSettingsPress}
|
|
135
|
+ />
|
131
|
136
|
</MaterialHeaderButtons>
|
132
|
137
|
),
|
133
|
138
|
});
|
|
@@ -143,6 +148,15 @@ class ProxiwashScreen extends React.Component<PropsType, StateType> {
|
143
|
148
|
};
|
144
|
149
|
|
145
|
150
|
/**
|
|
151
|
+ * Callback used when pressing the settings button.
|
|
152
|
+ * This will open the ProxiwashSettingsScreen.
|
|
153
|
+ */
|
|
154
|
+ onSettingsPress = () => {
|
|
155
|
+ const {navigation} = this.props;
|
|
156
|
+ navigation.navigate('proxiwash-settings');
|
|
157
|
+ };
|
|
158
|
+
|
|
159
|
+ /**
|
146
|
160
|
* Callback used when the user clicks on enable notifications for a machine
|
147
|
161
|
*
|
148
|
162
|
* @param machine The machine to set notifications for
|
|
@@ -422,34 +436,6 @@ class ProxiwashScreen extends React.Component<PropsType, StateType> {
|
422
|
436
|
}
|
423
|
437
|
};
|
424
|
438
|
|
425
|
|
- onPressCallback = () => {
|
426
|
|
- const {navigation} = this.props;
|
427
|
|
- navigation.navigate('proxiwash-settings');
|
428
|
|
- };
|
429
|
|
-
|
430
|
|
- getListHeader = (): React.Node => {
|
431
|
|
- const {selectedWash} = this.state;
|
432
|
|
- let item: LaverieType;
|
433
|
|
- switch (selectedWash) {
|
434
|
|
- case 'tripodeB':
|
435
|
|
- item = PROXIWASH_DATA.tripodeB;
|
436
|
|
- break;
|
437
|
|
- default:
|
438
|
|
- item = PROXIWASH_DATA.washinsa;
|
439
|
|
- }
|
440
|
|
- const getItemIcon = (props: ListIconPropsType): React.Node =>
|
441
|
|
- ProxiwashScreen.getItemIcon(item, props);
|
442
|
|
- return (
|
443
|
|
- <List.Item
|
444
|
|
- title={item.title}
|
445
|
|
- description={item.subtitle}
|
446
|
|
- left={getItemIcon}
|
447
|
|
- right={ProxiwashScreen.getChevronIcon}
|
448
|
|
- onPress={this.onPressCallback}
|
449
|
|
- />
|
450
|
|
- );
|
451
|
|
- };
|
452
|
|
-
|
453
|
439
|
/**
|
454
|
440
|
* Adds the given notifications associated to a machine ID to the watchlist, and saves the array to the preferences
|
455
|
441
|
*
|
|
@@ -519,7 +505,6 @@ class ProxiwashScreen extends React.Component<PropsType, StateType> {
|
519
|
505
|
autoRefreshTime={REFRESH_TIME}
|
520
|
506
|
refreshOnFocus
|
521
|
507
|
updateData={state.machinesWatched.length}
|
522
|
|
- renderListHeaderComponent={this.getListHeader}
|
523
|
508
|
/>
|
524
|
509
|
</View>
|
525
|
510
|
<MascotPopup
|