|
@@ -18,6 +18,7 @@ import type {CustomTheme} from "../../managers/ThemeManager";
|
18
|
18
|
import {Collapsible} from "react-navigation-collapsible";
|
19
|
19
|
import {StackNavigationProp} from "@react-navigation/stack";
|
20
|
20
|
import {getCleanedMachineWatched, getMachineEndDate, isMachineWatched} from "../../utils/Proxiwash";
|
|
21
|
+import {Modalize} from "react-native-modalize";
|
21
|
22
|
|
22
|
23
|
const DATA_URL = "https://etud.insa-toulouse.fr/~amicale_app/washinsa/washinsa.json";
|
23
|
24
|
|
|
@@ -55,9 +56,12 @@ type State = {
|
55
|
56
|
*/
|
56
|
57
|
class ProxiwashScreen extends React.Component<Props, State> {
|
57
|
58
|
|
58
|
|
- modalRef: Object;
|
|
59
|
+ modalRef: null | Modalize;
|
59
|
60
|
|
60
|
|
- fetchedData: Object;
|
|
61
|
+ fetchedData: {
|
|
62
|
+ dryers: Array<Machine>,
|
|
63
|
+ washers: Array<Machine>,
|
|
64
|
+ };
|
61
|
65
|
|
62
|
66
|
state = {
|
63
|
67
|
refreshing: false,
|
|
@@ -95,7 +99,10 @@ class ProxiwashScreen extends React.Component<Props, State> {
|
95
|
99
|
*/
|
96
|
100
|
componentDidMount() {
|
97
|
101
|
this.props.navigation.setOptions({
|
98
|
|
- headerRight: this.getAboutButton,
|
|
102
|
+ headerRight:
|
|
103
|
+ <MaterialHeaderButtons>
|
|
104
|
+ <Item title="information" iconName="information" onPress={this.onAboutPress}/>
|
|
105
|
+ </MaterialHeaderButtons>,
|
99
|
106
|
});
|
100
|
107
|
}
|
101
|
108
|
|
|
@@ -106,16 +113,6 @@ class ProxiwashScreen extends React.Component<Props, State> {
|
106
|
113
|
onAboutPress = () => this.props.navigation.navigate('proxiwash-about');
|
107
|
114
|
|
108
|
115
|
/**
|
109
|
|
- * Gets the about header button
|
110
|
|
- *
|
111
|
|
- * @return {*}
|
112
|
|
- */
|
113
|
|
- getAboutButton = () =>
|
114
|
|
- <MaterialHeaderButtons>
|
115
|
|
- <Item title="information" iconName="information" onPress={this.onAboutPress}/>
|
116
|
|
- </MaterialHeaderButtons>;
|
117
|
|
-
|
118
|
|
- /**
|
119
|
116
|
* Extracts the key for the given item
|
120
|
117
|
*
|
121
|
118
|
* @param item The item to extract the key from
|
|
@@ -123,7 +120,6 @@ class ProxiwashScreen extends React.Component<Props, State> {
|
123
|
120
|
*/
|
124
|
121
|
getKeyExtractor = (item: Machine) => item.number;
|
125
|
122
|
|
126
|
|
-
|
127
|
123
|
/**
|
128
|
124
|
* Setups notifications for the machine with the given ID.
|
129
|
125
|
* One notification will be sent at the end of the program.
|
|
@@ -141,7 +137,7 @@ class ProxiwashScreen extends React.Component<Props, State> {
|
141
|
137
|
this.showNotificationsDisabledWarning();
|
142
|
138
|
});
|
143
|
139
|
} else {
|
144
|
|
- Notifications.setupMachineNotification(machine.number, false)
|
|
140
|
+ Notifications.setupMachineNotification(machine.number, false, null)
|
145
|
141
|
.then(() => {
|
146
|
142
|
this.removeNotificationFromState(machine);
|
147
|
143
|
});
|