2019-06-29 13:37:21 +02:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import * as React from 'react';
|
2019-08-06 13:28:11 +02:00
|
|
|
import {Alert, Platform, View} from 'react-native';
|
2019-07-30 20:40:17 +02:00
|
|
|
import {Body, Card, CardItem, Left, Right, Text} from 'native-base';
|
2019-09-28 12:01:19 +02:00
|
|
|
import ThemeManager from '../../utils/ThemeManager';
|
2019-06-27 19:33:22 +02:00
|
|
|
import i18n from "i18n-js";
|
2019-09-28 12:01:19 +02:00
|
|
|
import CustomMaterialIcon from "../../components/CustomMaterialIcon";
|
|
|
|
import FetchedDataSectionList from "../../components/FetchedDataSectionList";
|
|
|
|
import NotificationsManager from "../../utils/NotificationsManager";
|
2019-07-30 20:40:17 +02:00
|
|
|
import PlatformTouchable from "react-native-platform-touchable";
|
2019-08-09 10:54:05 +02:00
|
|
|
import Touchable from "react-native-platform-touchable";
|
2019-09-28 12:01:19 +02:00
|
|
|
import AsyncStorageManager from "../../utils/AsyncStorageManager";
|
2019-08-04 14:28:41 +02:00
|
|
|
import * as Expo from "expo";
|
2019-06-27 19:33:22 +02:00
|
|
|
|
2019-08-13 12:20:03 +02:00
|
|
|
const DATA_URL = "https://srv-falcon.etud.insa-toulouse.fr/~amicale_app/washinsa/washinsa.json";
|
2019-06-27 19:33:22 +02:00
|
|
|
|
|
|
|
const MACHINE_STATES = {
|
2019-08-08 18:05:18 +02:00
|
|
|
"TERMINE": "0",
|
|
|
|
"DISPONIBLE": "1",
|
|
|
|
"EN COURS": "2",
|
|
|
|
"HS": "3",
|
|
|
|
"ERREUR": "4"
|
2019-06-27 19:33:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
let stateStrings = {};
|
2019-07-30 20:40:17 +02:00
|
|
|
let modalStateStrings = {};
|
2019-07-28 00:32:49 +02:00
|
|
|
let stateIcons = {};
|
2019-06-27 19:33:22 +02:00
|
|
|
let stateColors = {};
|
|
|
|
|
2019-10-09 19:58:22 +02:00
|
|
|
const REFRESH_TIME = 1000 * 10; // Refresh every 10 seconds
|
2019-06-29 13:37:21 +02:00
|
|
|
|
2019-06-29 15:43:57 +02:00
|
|
|
/**
|
|
|
|
* Class defining the app's proxiwash screen. This screen shows information about washing machines and
|
|
|
|
* dryers, taken from a scrapper reading proxiwash website
|
|
|
|
*/
|
2019-07-26 14:14:01 +02:00
|
|
|
export default class ProxiwashScreen extends FetchedDataSectionList {
|
2019-06-25 22:20:24 +02:00
|
|
|
|
2019-06-29 15:43:57 +02:00
|
|
|
/**
|
|
|
|
* Creates machine state parameters using current theme and translations
|
|
|
|
*/
|
2019-07-26 14:14:01 +02:00
|
|
|
constructor() {
|
2019-10-09 19:58:22 +02:00
|
|
|
super(DATA_URL, REFRESH_TIME);
|
2019-07-31 14:22:36 +02:00
|
|
|
let colors = ThemeManager.getCurrentThemeVariables();
|
2019-06-28 11:35:15 +02:00
|
|
|
stateColors[MACHINE_STATES.TERMINE] = colors.proxiwashFinishedColor;
|
|
|
|
stateColors[MACHINE_STATES.DISPONIBLE] = colors.proxiwashReadyColor;
|
2019-08-08 18:05:18 +02:00
|
|
|
stateColors[MACHINE_STATES["EN COURS"]] = colors.proxiwashRunningColor;
|
2019-06-28 11:35:15 +02:00
|
|
|
stateColors[MACHINE_STATES.HS] = colors.proxiwashBrokenColor;
|
|
|
|
stateColors[MACHINE_STATES.ERREUR] = colors.proxiwashErrorColor;
|
2019-06-27 19:33:22 +02:00
|
|
|
|
|
|
|
stateStrings[MACHINE_STATES.TERMINE] = i18n.t('proxiwashScreen.states.finished');
|
|
|
|
stateStrings[MACHINE_STATES.DISPONIBLE] = i18n.t('proxiwashScreen.states.ready');
|
2019-08-08 18:05:18 +02:00
|
|
|
stateStrings[MACHINE_STATES["EN COURS"]] = i18n.t('proxiwashScreen.states.running');
|
2019-06-27 19:33:22 +02:00
|
|
|
stateStrings[MACHINE_STATES.HS] = i18n.t('proxiwashScreen.states.broken');
|
|
|
|
stateStrings[MACHINE_STATES.ERREUR] = i18n.t('proxiwashScreen.states.error');
|
2019-07-28 00:32:49 +02:00
|
|
|
|
2019-07-30 20:40:17 +02:00
|
|
|
modalStateStrings[MACHINE_STATES.TERMINE] = i18n.t('proxiwashScreen.modal.finished');
|
|
|
|
modalStateStrings[MACHINE_STATES.DISPONIBLE] = i18n.t('proxiwashScreen.modal.ready');
|
2019-08-08 18:05:18 +02:00
|
|
|
modalStateStrings[MACHINE_STATES["EN COURS"]] = i18n.t('proxiwashScreen.modal.running');
|
2019-07-30 20:40:17 +02:00
|
|
|
modalStateStrings[MACHINE_STATES.HS] = i18n.t('proxiwashScreen.modal.broken');
|
|
|
|
modalStateStrings[MACHINE_STATES.ERREUR] = i18n.t('proxiwashScreen.modal.error');
|
|
|
|
|
2019-07-28 00:32:49 +02:00
|
|
|
stateIcons[MACHINE_STATES.TERMINE] = 'check-circle';
|
|
|
|
stateIcons[MACHINE_STATES.DISPONIBLE] = 'radiobox-blank';
|
2019-08-08 18:05:18 +02:00
|
|
|
stateIcons[MACHINE_STATES["EN COURS"]] = 'progress-check';
|
2019-07-28 00:32:49 +02:00
|
|
|
stateIcons[MACHINE_STATES.HS] = 'alert-octagram-outline';
|
|
|
|
stateIcons[MACHINE_STATES.ERREUR] = 'alert';
|
2019-07-31 14:22:36 +02:00
|
|
|
|
2019-08-13 12:20:03 +02:00
|
|
|
// let dataString = AsyncStorageManager.getInstance().preferences.proxiwashWatchedMachines.current;
|
2019-07-31 14:22:36 +02:00
|
|
|
this.state = {
|
|
|
|
refreshing: false,
|
|
|
|
firstLoading: true,
|
|
|
|
fetchedData: {},
|
2019-08-13 12:20:03 +02:00
|
|
|
// machinesWatched: JSON.parse(dataString),
|
|
|
|
machinesWatched: [],
|
2019-07-31 14:22:36 +02:00
|
|
|
};
|
2019-08-13 12:20:03 +02:00
|
|
|
this.setMinTimeRefresh(30);
|
2019-06-27 19:33:22 +02:00
|
|
|
}
|
|
|
|
|
2019-08-06 13:28:11 +02:00
|
|
|
/**
|
|
|
|
* Setup notification channel for android and add listeners to detect notifications fired
|
|
|
|
*/
|
2019-08-04 14:28:41 +02:00
|
|
|
componentDidMount() {
|
2019-08-05 15:02:41 +02:00
|
|
|
super.componentDidMount();
|
2019-08-13 12:53:21 +02:00
|
|
|
|
2019-09-12 23:23:36 +02:00
|
|
|
if (AsyncStorageManager.getInstance().preferences.expoToken.current !== '') {
|
|
|
|
// Get latest watchlist from server
|
2019-08-13 12:53:21 +02:00
|
|
|
NotificationsManager.getMachineNotificationWatchlist((fetchedList) => {
|
|
|
|
this.setState({machinesWatched: fetchedList})
|
|
|
|
});
|
2019-09-12 23:23:36 +02:00
|
|
|
// Get updated watchlist after received notification
|
|
|
|
Expo.Notifications.addListener((notification) => {
|
|
|
|
NotificationsManager.getMachineNotificationWatchlist((fetchedList) => {
|
|
|
|
this.setState({machinesWatched: fetchedList})
|
|
|
|
});
|
2019-08-04 14:28:41 +02:00
|
|
|
});
|
2019-09-12 23:23:36 +02:00
|
|
|
if (Platform.OS === 'android') {
|
|
|
|
Expo.Notifications.createChannelAndroidAsync('reminders', {
|
|
|
|
name: 'Reminders',
|
|
|
|
priority: 'max',
|
|
|
|
vibrate: [0, 250, 250, 250],
|
|
|
|
});
|
|
|
|
}
|
2019-08-04 14:28:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-26 14:14:01 +02:00
|
|
|
getHeaderTranslation() {
|
|
|
|
return i18n.t("screens.proxiwash");
|
|
|
|
}
|
|
|
|
|
|
|
|
getUpdateToastTranslations() {
|
|
|
|
return [i18n.t("proxiwashScreen.listUpdated"), i18n.t("proxiwashScreen.listUpdateFail")];
|
|
|
|
}
|
|
|
|
|
2019-07-31 14:22:36 +02:00
|
|
|
getDryersKeyExtractor(item: Object) {
|
|
|
|
return item !== undefined ? "dryer" + item.number : undefined;
|
|
|
|
}
|
|
|
|
|
|
|
|
getWashersKeyExtractor(item: Object) {
|
|
|
|
return item !== undefined ? "washer" + item.number : undefined;
|
2019-06-27 19:33:22 +02:00
|
|
|
}
|
|
|
|
|
2019-06-29 15:43:57 +02:00
|
|
|
/**
|
|
|
|
* Setup notifications for the machine with the given ID.
|
|
|
|
* One notification will be sent at the end of the program.
|
|
|
|
* Another will be send a few minutes before the end, based on the value of reminderNotifTime
|
|
|
|
*
|
|
|
|
* @param machineId The machine's ID
|
|
|
|
* @returns {Promise<void>}
|
|
|
|
*/
|
2019-08-13 12:20:03 +02:00
|
|
|
setupNotifications(machineId: string) {
|
2019-09-12 23:23:36 +02:00
|
|
|
if (AsyncStorageManager.getInstance().preferences.expoToken.current !== '') {
|
|
|
|
if (!this.isMachineWatched(machineId)) {
|
|
|
|
NotificationsManager.setupMachineNotification(machineId, true);
|
|
|
|
this.saveNotificationToState(machineId);
|
|
|
|
} else
|
|
|
|
this.disableNotification(machineId);
|
|
|
|
} else {
|
|
|
|
this.showNotificationsDisabledWarning();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
showNotificationsDisabledWarning() {
|
|
|
|
Alert.alert(
|
|
|
|
i18n.t("proxiwashScreen.modal.notificationErrorTitle"),
|
|
|
|
i18n.t("proxiwashScreen.modal.notificationErrorDescription"),
|
|
|
|
);
|
2019-06-27 19:33:22 +02:00
|
|
|
}
|
|
|
|
|
2019-06-29 15:43:57 +02:00
|
|
|
/**
|
|
|
|
* Stop scheduled notifications for the machine of the given ID.
|
|
|
|
* This will also remove the notification if it was already shown.
|
|
|
|
*
|
|
|
|
* @param machineId The machine's ID
|
|
|
|
*/
|
2019-06-29 13:37:21 +02:00
|
|
|
disableNotification(machineId: string) {
|
2019-08-04 14:28:41 +02:00
|
|
|
let data = this.state.machinesWatched;
|
2019-06-27 19:33:22 +02:00
|
|
|
if (data.length > 0) {
|
2019-08-13 12:20:03 +02:00
|
|
|
let arrayIndex = data.indexOf(machineId);
|
2019-07-31 14:22:36 +02:00
|
|
|
if (arrayIndex !== -1) {
|
2019-08-13 12:20:03 +02:00
|
|
|
NotificationsManager.setupMachineNotification(machineId, false);
|
2019-08-13 12:53:21 +02:00
|
|
|
this.removeNotificationFroState(arrayIndex);
|
2019-07-31 14:22:36 +02:00
|
|
|
}
|
2019-06-27 19:33:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-06 13:28:11 +02:00
|
|
|
/**
|
|
|
|
* Add the given notifications associated to a machine ID to the watchlist, and save the array to the preferences
|
|
|
|
*
|
|
|
|
* @param machineId
|
|
|
|
*/
|
2019-08-13 12:53:21 +02:00
|
|
|
saveNotificationToState(machineId: string) {
|
2019-07-31 14:22:36 +02:00
|
|
|
let data = this.state.machinesWatched;
|
2019-08-13 12:20:03 +02:00
|
|
|
data.push(machineId);
|
2019-08-13 12:53:21 +02:00
|
|
|
this.updateNotificationState(data);
|
2019-07-31 14:22:36 +02:00
|
|
|
}
|
|
|
|
|
2019-08-06 13:28:11 +02:00
|
|
|
/**
|
|
|
|
* remove the given index from the watchlist array and save it to preferences
|
|
|
|
*
|
|
|
|
* @param index
|
|
|
|
*/
|
2019-08-13 12:53:21 +02:00
|
|
|
removeNotificationFroState(index: number) {
|
2019-07-31 14:22:36 +02:00
|
|
|
let data = this.state.machinesWatched;
|
|
|
|
data.splice(index, 1);
|
2019-08-13 12:53:21 +02:00
|
|
|
this.updateNotificationState(data);
|
2019-07-31 14:22:36 +02:00
|
|
|
}
|
|
|
|
|
2019-08-06 13:28:11 +02:00
|
|
|
/**
|
|
|
|
* Set the given data as the watchlist and save it to preferences
|
|
|
|
*
|
|
|
|
* @param data
|
|
|
|
*/
|
2019-08-13 12:53:21 +02:00
|
|
|
updateNotificationState(data: Array<Object>) {
|
2019-07-31 14:22:36 +02:00
|
|
|
this.setState({machinesWatched: data});
|
2019-08-13 12:20:03 +02:00
|
|
|
// let prefKey = AsyncStorageManager.getInstance().preferences.proxiwashWatchedMachines.key;
|
|
|
|
// AsyncStorageManager.getInstance().savePref(prefKey, JSON.stringify(data));
|
2019-07-31 14:22:36 +02:00
|
|
|
}
|
|
|
|
|
2019-06-29 15:43:57 +02:00
|
|
|
/**
|
|
|
|
* Checks whether the machine of the given ID has scheduled notifications
|
|
|
|
*
|
|
|
|
* @param machineID The machine's ID
|
|
|
|
* @returns {boolean}
|
|
|
|
*/
|
|
|
|
isMachineWatched(machineID: string) {
|
2019-08-13 12:20:03 +02:00
|
|
|
return this.state.machinesWatched.indexOf(machineID) !== -1;
|
2019-06-27 19:33:22 +02:00
|
|
|
}
|
|
|
|
|
2019-07-26 14:14:01 +02:00
|
|
|
createDataset(fetchedData: Object) {
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
title: i18n.t('proxiwashScreen.washers'),
|
2019-07-30 20:40:17 +02:00
|
|
|
icon: 'washing-machine',
|
2019-07-26 14:14:01 +02:00
|
|
|
data: fetchedData.washers === undefined ? [] : fetchedData.washers,
|
2019-07-31 14:22:36 +02:00
|
|
|
extraData: super.state,
|
|
|
|
keyExtractor: this.getWashersKeyExtractor
|
2019-07-26 14:14:01 +02:00
|
|
|
},
|
2019-08-08 13:57:03 +02:00
|
|
|
{
|
|
|
|
title: i18n.t('proxiwashScreen.dryers'),
|
|
|
|
icon: 'tumble-dryer',
|
|
|
|
data: fetchedData.dryers === undefined ? [] : fetchedData.dryers,
|
|
|
|
extraData: super.state,
|
|
|
|
keyExtractor: this.getDryersKeyExtractor
|
|
|
|
},
|
|
|
|
|
2019-07-26 14:14:01 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2019-07-28 12:40:35 +02:00
|
|
|
hasTabs(): boolean {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-08-06 13:28:11 +02:00
|
|
|
/**
|
|
|
|
* Show an alert fo a machine, allowing to enable/disable notifications if running
|
|
|
|
*
|
|
|
|
* @param title
|
|
|
|
* @param item
|
2019-08-09 10:54:05 +02:00
|
|
|
* @param isDryer
|
2019-08-06 13:28:11 +02:00
|
|
|
*/
|
2019-08-23 14:13:22 +02:00
|
|
|
showAlert(title: string, item: Object, isDryer: boolean) {
|
2019-07-30 20:40:17 +02:00
|
|
|
let buttons = [{text: i18n.t("proxiwashScreen.modal.ok")}];
|
|
|
|
let message = modalStateStrings[MACHINE_STATES[item.state]];
|
2019-08-08 18:05:18 +02:00
|
|
|
if (MACHINE_STATES[item.state] === MACHINE_STATES["EN COURS"]) {
|
2019-07-30 20:40:17 +02:00
|
|
|
buttons = [
|
|
|
|
{
|
|
|
|
text: this.isMachineWatched(item.number) ?
|
|
|
|
i18n.t("proxiwashScreen.modal.disableNotifications") :
|
|
|
|
i18n.t("proxiwashScreen.modal.enableNotifications"),
|
2019-08-13 12:20:03 +02:00
|
|
|
onPress: () => this.setupNotifications(item.number)
|
2019-07-30 20:40:17 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
text: i18n.t("proxiwashScreen.modal.cancel")
|
|
|
|
}
|
|
|
|
];
|
|
|
|
message = i18n.t('proxiwashScreen.modal.running',
|
|
|
|
{
|
|
|
|
start: item.startTime,
|
|
|
|
end: item.endTime,
|
2019-08-23 14:13:22 +02:00
|
|
|
remaining: item.remainingTime
|
2019-07-30 20:40:17 +02:00
|
|
|
});
|
2019-08-09 10:54:05 +02:00
|
|
|
} else if (MACHINE_STATES[item.state] === MACHINE_STATES.DISPONIBLE) {
|
|
|
|
if (isDryer)
|
|
|
|
message += '\n' + i18n.t('proxiwashScreen.dryersTariff');
|
|
|
|
else
|
|
|
|
message += '\n' + i18n.t('proxiwashScreen.washersTariff');
|
2019-07-30 20:40:17 +02:00
|
|
|
}
|
|
|
|
Alert.alert(
|
|
|
|
title,
|
|
|
|
message,
|
|
|
|
buttons
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2019-08-08 18:05:18 +02:00
|
|
|
getRightButton(): * {
|
|
|
|
return (
|
|
|
|
<Touchable
|
|
|
|
style={{padding: 6}}
|
|
|
|
onPress={() => this.props.navigation.navigate('ProxiwashAboutScreen')}>
|
|
|
|
<CustomMaterialIcon
|
|
|
|
color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
|
|
|
|
icon="information"/>
|
|
|
|
</Touchable>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2019-06-29 15:43:57 +02:00
|
|
|
/**
|
|
|
|
* Get list item to be rendered
|
|
|
|
*
|
2019-07-26 14:14:01 +02:00
|
|
|
* @param item The object containing the item's FetchedData
|
2019-06-29 15:43:57 +02:00
|
|
|
* @param section The object describing the current SectionList section
|
2019-07-26 14:14:01 +02:00
|
|
|
* @param data The full FetchedData used by the SectionList
|
2019-06-29 15:43:57 +02:00
|
|
|
* @returns {React.Node}
|
|
|
|
*/
|
2019-07-26 14:14:01 +02:00
|
|
|
getRenderItem(item: Object, section: Object, data: Object) {
|
2019-08-08 18:05:18 +02:00
|
|
|
let isMachineRunning = MACHINE_STATES[item.state] === MACHINE_STATES["EN COURS"];
|
2019-07-30 20:40:17 +02:00
|
|
|
let machineName = (section.title === i18n.t('proxiwashScreen.dryers') ? i18n.t('proxiwashScreen.dryer') : i18n.t('proxiwashScreen.washer')) + ' n°' + item.number;
|
2019-08-09 10:54:05 +02:00
|
|
|
let isDryer = section.title === i18n.t('proxiwashScreen.dryers');
|
2019-06-27 19:33:22 +02:00
|
|
|
return (
|
2019-07-28 00:32:49 +02:00
|
|
|
<Card style={{
|
|
|
|
flex: 0,
|
2019-07-31 14:34:38 +02:00
|
|
|
height: 64,
|
|
|
|
marginLeft: 10,
|
|
|
|
marginRight: 10
|
2019-07-28 00:32:49 +02:00
|
|
|
}}>
|
|
|
|
|
|
|
|
<CardItem
|
|
|
|
style={{
|
|
|
|
backgroundColor: stateColors[MACHINE_STATES[item.state]],
|
2019-07-30 20:40:17 +02:00
|
|
|
paddingRight: 0,
|
|
|
|
paddingLeft: 0,
|
|
|
|
height: '100%',
|
2019-07-28 00:32:49 +02:00
|
|
|
}}
|
|
|
|
>
|
|
|
|
<View style={{
|
|
|
|
height: 64,
|
|
|
|
position: 'absolute',
|
|
|
|
right: 0,
|
|
|
|
width: item.donePercent !== '' ? (100 - parseInt(item.donePercent)).toString() + '%' : 0,
|
2019-07-31 14:22:36 +02:00
|
|
|
backgroundColor: ThemeManager.getCurrentThemeVariables().containerBgColor
|
2019-07-28 00:32:49 +02:00
|
|
|
}}/>
|
2019-07-30 20:40:17 +02:00
|
|
|
<PlatformTouchable
|
2019-08-23 14:13:22 +02:00
|
|
|
onPress={() => this.showAlert(machineName, item, isDryer)}
|
2019-07-30 20:40:17 +02:00
|
|
|
style={{
|
|
|
|
height: 64,
|
|
|
|
position: 'absolute',
|
2019-08-05 14:52:18 +02:00
|
|
|
zIndex: 10, // Make sure the button is above the text
|
2019-07-30 20:40:17 +02:00
|
|
|
right: 0,
|
|
|
|
width: '100%'
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<View/>
|
|
|
|
</PlatformTouchable>
|
|
|
|
<Left style={{marginLeft: 10}}>
|
|
|
|
<CustomMaterialIcon
|
2019-08-09 10:54:05 +02:00
|
|
|
icon={isDryer ? 'tumble-dryer' : 'washing-machine'}
|
2019-07-30 20:40:17 +02:00
|
|
|
fontSize={30}
|
2019-07-28 00:32:49 +02:00
|
|
|
/>
|
|
|
|
<Body>
|
2019-06-27 19:33:22 +02:00
|
|
|
<Text>
|
2019-07-30 20:40:17 +02:00
|
|
|
{machineName + ' '}
|
|
|
|
{this.isMachineWatched(item.number) ?
|
|
|
|
<CustomMaterialIcon
|
|
|
|
icon='bell-ring'
|
2019-07-31 14:22:36 +02:00
|
|
|
color={ThemeManager.getCurrentThemeVariables().brandPrimary}
|
2019-07-30 20:40:17 +02:00
|
|
|
fontSize={20}
|
|
|
|
/> : ''}
|
2019-07-28 00:32:49 +02:00
|
|
|
</Text>
|
|
|
|
<Text note>
|
2019-07-30 20:40:17 +02:00
|
|
|
{isMachineRunning ? item.startTime + '/' + item.endTime : ''}
|
2019-06-27 19:33:22 +02:00
|
|
|
</Text>
|
2019-07-28 00:32:49 +02:00
|
|
|
</Body>
|
|
|
|
</Left>
|
2019-07-30 20:40:17 +02:00
|
|
|
<Right style={{marginRight: 10}}>
|
2019-07-28 00:32:49 +02:00
|
|
|
<Text style={MACHINE_STATES[item.state] === MACHINE_STATES.TERMINE ?
|
2019-06-27 19:33:22 +02:00
|
|
|
{fontWeight: 'bold'} : {}}
|
2019-07-28 00:32:49 +02:00
|
|
|
>
|
|
|
|
{stateStrings[MACHINE_STATES[item.state]]}
|
|
|
|
</Text>
|
|
|
|
<CustomMaterialIcon icon={stateIcons[MACHINE_STATES[item.state]]}
|
|
|
|
fontSize={25}
|
|
|
|
/>
|
|
|
|
</Right>
|
|
|
|
</CardItem>
|
|
|
|
</Card>);
|
2019-06-27 19:33:22 +02:00
|
|
|
}
|
2019-06-25 22:20:24 +02:00
|
|
|
}
|