diff --git a/src/components/Lists/Proxiwash/ProxiwashListItem.js b/src/components/Lists/Proxiwash/ProxiwashListItem.js index 60fc01f..bee78f2 100644 --- a/src/components/Lists/Proxiwash/ProxiwashListItem.js +++ b/src/components/Lists/Proxiwash/ProxiwashListItem.js @@ -59,6 +59,8 @@ class ProxiwashListItem extends React.Component { title: string; + titlePopUp: string; + constructor(props: PropsType) { super(props); this.stateColors = {}; @@ -67,7 +69,7 @@ class ProxiwashListItem extends React.Component { this.updateStateStrings(); let displayNumber = props.item.number; - const displayMaxWeight = props.item.maxWeight; + const displayMaxWeight = props.item['maxWeight ']; if (AprilFoolsManager.getInstance().isAprilFoolsEnabled()) displayNumber = AprilFoolsManager.getProxiwashMachineDisplayNumber( parseInt(props.item.number, 10), @@ -76,7 +78,8 @@ class ProxiwashListItem extends React.Component { this.title = props.isDryer ? i18n.t('screens.proxiwash.dryer') : i18n.t('screens.proxiwash.washer'); - this.title += ` n°${displayNumber} - ${displayMaxWeight} kg`; + this.title += ` n°${displayNumber}`; + this.titlePopUp = `${this.title} - ${displayMaxWeight} kg`; } shouldComponentUpdate(nextProps: PropsType): boolean { @@ -91,7 +94,7 @@ class ProxiwashListItem extends React.Component { onListItemPress = () => { const {props} = this; - props.onPress(this.title, props.item, props.isDryer); + props.onPress(this.titlePopUp, props.item, props.isDryer); }; updateStateStrings() { diff --git a/src/screens/Proxiwash/ProxiwashScreen.js b/src/screens/Proxiwash/ProxiwashScreen.js index 756172e..d5944b8 100644 --- a/src/screens/Proxiwash/ProxiwashScreen.js +++ b/src/screens/Proxiwash/ProxiwashScreen.js @@ -37,7 +37,7 @@ const LIST_ITEM_HEIGHT = 64; export type ProxiwashMachineType = { number: string, state: string, - maxWeight: number, + 'maxWeight ': number, startTime: string, endTime: string, donePercent: string, @@ -128,6 +128,11 @@ class ProxiwashScreen extends React.Component { iconName="information" onPress={this.onAboutPress} /> + ), }); @@ -142,6 +147,15 @@ class ProxiwashScreen extends React.Component { navigation.navigate('proxiwash-about'); }; + /** + * Callback used when pressing the settings button. + * This will open the ProxiwashSettingsScreen. + */ + onSettingsPress = () => { + const {navigation} = this.props; + navigation.navigate('proxiwash-settings'); + }; + /** * Callback used when the user clicks on enable notifications for a machine * @@ -422,34 +436,6 @@ class ProxiwashScreen extends React.Component { } }; - onPressCallback = () => { - const {navigation} = this.props; - navigation.navigate('proxiwash-settings'); - }; - - getListHeader = (): React.Node => { - const {selectedWash} = this.state; - let item: LaverieType; - switch (selectedWash) { - case 'tripodeB': - item = PROXIWASH_DATA.tripodeB; - break; - default: - item = PROXIWASH_DATA.washinsa; - } - const getItemIcon = (props: ListIconPropsType): React.Node => - ProxiwashScreen.getItemIcon(item, props); - return ( - - ); - }; - /** * Adds the given notifications associated to a machine ID to the watchlist, and saves the array to the preferences * @@ -519,7 +505,6 @@ class ProxiwashScreen extends React.Component { autoRefreshTime={REFRESH_TIME} refreshOnFocus updateData={state.machinesWatched.length} - renderListHeaderComponent={this.getListHeader} />