Compare commits
No commits in common. "eaf1c52af5f571fcb8f213dde40c36a4c4a1a9fc" and "f5233c53f856627bc3a0482c1fe432403b4ab3dc" have entirely different histories.
eaf1c52af5
...
f5233c53f8
3 changed files with 49 additions and 49 deletions
|
|
@ -67,22 +67,22 @@ const styles = StyleSheet.create({
|
|||
},
|
||||
});
|
||||
|
||||
const stateStrings: {[key in MachineStates]: string} = {
|
||||
[MachineStates.AVAILABLE]: i18n.t('screens.proxiwash.states.ready'),
|
||||
[MachineStates.RUNNING]: i18n.t('screens.proxiwash.states.running'),
|
||||
[MachineStates.RUNNING_NOT_STARTED]: i18n.t(
|
||||
'screens.proxiwash.states.runningNotStarted',
|
||||
),
|
||||
[MachineStates.FINISHED]: i18n.t('screens.proxiwash.states.finished'),
|
||||
[MachineStates.UNAVAILABLE]: i18n.t('screens.proxiwash.states.broken'),
|
||||
[MachineStates.ERROR]: i18n.t('screens.proxiwash.states.error'),
|
||||
[MachineStates.UNKNOWN]: i18n.t('screens.proxiwash.states.unknown'),
|
||||
};
|
||||
|
||||
/**
|
||||
* Component used to display a proxiwash item, showing machine progression and state
|
||||
*/
|
||||
class ProxiwashListItem extends React.Component<PropsType> {
|
||||
stateStrings: {[key in MachineStates]: string} = {
|
||||
[MachineStates.AVAILABLE]: i18n.t('screens.proxiwash.states.ready'),
|
||||
[MachineStates.RUNNING]: i18n.t('screens.proxiwash.states.running'),
|
||||
[MachineStates.RUNNING_NOT_STARTED]: i18n.t(
|
||||
'screens.proxiwash.states.runningNotStarted',
|
||||
),
|
||||
[MachineStates.FINISHED]: i18n.t('screens.proxiwash.states.finished'),
|
||||
[MachineStates.UNAVAILABLE]: i18n.t('screens.proxiwash.states.broken'),
|
||||
[MachineStates.ERROR]: i18n.t('screens.proxiwash.states.error'),
|
||||
[MachineStates.UNKNOWN]: i18n.t('screens.proxiwash.states.unknown'),
|
||||
};
|
||||
|
||||
stateColors: {[key: string]: string};
|
||||
|
||||
title: string;
|
||||
|
|
@ -146,7 +146,7 @@ class ProxiwashListItem extends React.Component<PropsType> {
|
|||
? `${props.item.startTime}/${props.item.endTime}`
|
||||
: '';
|
||||
const stateIcon = ProxiwashConstants.stateIcons[machineState];
|
||||
const stateString = this.stateStrings[machineState];
|
||||
const stateString = stateStrings[machineState];
|
||||
let progress;
|
||||
if (isRunning && props.item.donePercent !== '') {
|
||||
progress = parseFloat(props.item.donePercent) / 100;
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class AboutScreen extends React.Component<PropsType, StateType> {
|
|||
/**
|
||||
* Object containing data relative to major contributors
|
||||
*/
|
||||
majorContributors: {[key: string]: MemberItemType} = {
|
||||
static majorContributors: {[key: string]: MemberItemType} = {
|
||||
arnaud: {
|
||||
name: 'Arnaud Vergnet',
|
||||
message: i18n.t('screens.about.user.arnaud'),
|
||||
|
|
@ -115,7 +115,7 @@ class AboutScreen extends React.Component<PropsType, StateType> {
|
|||
/**
|
||||
* Object containing data relative to users who helped during development
|
||||
*/
|
||||
helpfulUsers: {[key: string]: MemberItemType} = {
|
||||
static helpfulUsers: {[key: string]: MemberItemType} = {
|
||||
beranger: {
|
||||
name: 'Béranger Quintana Y Arciosana',
|
||||
message: i18n.t('screens.about.user.beranger'),
|
||||
|
|
@ -199,18 +199,18 @@ class AboutScreen extends React.Component<PropsType, StateType> {
|
|||
teamData: Array<ListItemType> = [
|
||||
{
|
||||
onPressCallback: () => {
|
||||
this.onContributorListItemPress(this.majorContributors.arnaud);
|
||||
this.onContributorListItemPress(AboutScreen.majorContributors.arnaud);
|
||||
},
|
||||
icon: this.majorContributors.arnaud.icon,
|
||||
text: this.majorContributors.arnaud.name,
|
||||
icon: AboutScreen.majorContributors.arnaud.icon,
|
||||
text: AboutScreen.majorContributors.arnaud.name,
|
||||
showChevron: false,
|
||||
},
|
||||
{
|
||||
onPressCallback: () => {
|
||||
this.onContributorListItemPress(this.majorContributors.yohan);
|
||||
this.onContributorListItemPress(AboutScreen.majorContributors.yohan);
|
||||
},
|
||||
icon: this.majorContributors.yohan.icon,
|
||||
text: this.majorContributors.yohan.name,
|
||||
icon: AboutScreen.majorContributors.yohan.icon,
|
||||
text: AboutScreen.majorContributors.yohan.name,
|
||||
showChevron: false,
|
||||
},
|
||||
{
|
||||
|
|
@ -230,42 +230,42 @@ class AboutScreen extends React.Component<PropsType, StateType> {
|
|||
thanksData: Array<ListItemType> = [
|
||||
{
|
||||
onPressCallback: () => {
|
||||
this.onContributorListItemPress(this.helpfulUsers.beranger);
|
||||
this.onContributorListItemPress(AboutScreen.helpfulUsers.beranger);
|
||||
},
|
||||
icon: this.helpfulUsers.beranger.icon,
|
||||
text: this.helpfulUsers.beranger.name,
|
||||
icon: AboutScreen.helpfulUsers.beranger.icon,
|
||||
text: AboutScreen.helpfulUsers.beranger.name,
|
||||
showChevron: false,
|
||||
},
|
||||
{
|
||||
onPressCallback: () => {
|
||||
this.onContributorListItemPress(this.helpfulUsers.celine);
|
||||
this.onContributorListItemPress(AboutScreen.helpfulUsers.celine);
|
||||
},
|
||||
icon: this.helpfulUsers.celine.icon,
|
||||
text: this.helpfulUsers.celine.name,
|
||||
icon: AboutScreen.helpfulUsers.celine.icon,
|
||||
text: AboutScreen.helpfulUsers.celine.name,
|
||||
showChevron: false,
|
||||
},
|
||||
{
|
||||
onPressCallback: () => {
|
||||
this.onContributorListItemPress(this.helpfulUsers.damien);
|
||||
this.onContributorListItemPress(AboutScreen.helpfulUsers.damien);
|
||||
},
|
||||
icon: this.helpfulUsers.damien.icon,
|
||||
text: this.helpfulUsers.damien.name,
|
||||
icon: AboutScreen.helpfulUsers.damien.icon,
|
||||
text: AboutScreen.helpfulUsers.damien.name,
|
||||
showChevron: false,
|
||||
},
|
||||
{
|
||||
onPressCallback: () => {
|
||||
this.onContributorListItemPress(this.helpfulUsers.titouan);
|
||||
this.onContributorListItemPress(AboutScreen.helpfulUsers.titouan);
|
||||
},
|
||||
icon: this.helpfulUsers.titouan.icon,
|
||||
text: this.helpfulUsers.titouan.name,
|
||||
icon: AboutScreen.helpfulUsers.titouan.icon,
|
||||
text: AboutScreen.helpfulUsers.titouan.name,
|
||||
showChevron: false,
|
||||
},
|
||||
{
|
||||
onPressCallback: () => {
|
||||
this.onContributorListItemPress(this.helpfulUsers.theo);
|
||||
this.onContributorListItemPress(AboutScreen.helpfulUsers.theo);
|
||||
},
|
||||
icon: this.helpfulUsers.theo.icon,
|
||||
text: this.helpfulUsers.theo.name,
|
||||
icon: AboutScreen.helpfulUsers.theo.icon,
|
||||
text: AboutScreen.helpfulUsers.theo.name,
|
||||
showChevron: false,
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -46,6 +46,18 @@ import MascotPopup from '../../components/Mascot/MascotPopup';
|
|||
import type {SectionListDataType} from '../../components/Screens/WebSectionList';
|
||||
import type {LaundromatType} from './ProxiwashAboutScreen';
|
||||
|
||||
const modalStateStrings: {[key in MachineStates]: string} = {
|
||||
[MachineStates.AVAILABLE]: i18n.t('screens.proxiwash.modal.ready'),
|
||||
[MachineStates.RUNNING]: i18n.t('screens.proxiwash.modal.running'),
|
||||
[MachineStates.RUNNING_NOT_STARTED]: i18n.t(
|
||||
'screens.proxiwash.modal.runningNotStarted',
|
||||
),
|
||||
[MachineStates.FINISHED]: i18n.t('screens.proxiwash.modal.finished'),
|
||||
[MachineStates.UNAVAILABLE]: i18n.t('screens.proxiwash.modal.broken'),
|
||||
[MachineStates.ERROR]: i18n.t('screens.proxiwash.modal.error'),
|
||||
[MachineStates.UNKNOWN]: i18n.t('screens.proxiwash.modal.unknown'),
|
||||
};
|
||||
|
||||
const REFRESH_TIME = 1000 * 10; // Refresh every 10 seconds
|
||||
const LIST_ITEM_HEIGHT = 64;
|
||||
|
||||
|
|
@ -86,18 +98,6 @@ class ProxiwashScreen extends React.Component<PropsType, StateType> {
|
|||
);
|
||||
}
|
||||
|
||||
modalStateStrings: {[key in MachineStates]: string} = {
|
||||
[MachineStates.AVAILABLE]: i18n.t('screens.proxiwash.modal.ready'),
|
||||
[MachineStates.RUNNING]: i18n.t('screens.proxiwash.modal.running'),
|
||||
[MachineStates.RUNNING_NOT_STARTED]: i18n.t(
|
||||
'screens.proxiwash.modal.runningNotStarted',
|
||||
),
|
||||
[MachineStates.FINISHED]: i18n.t('screens.proxiwash.modal.finished'),
|
||||
[MachineStates.UNAVAILABLE]: i18n.t('screens.proxiwash.modal.broken'),
|
||||
[MachineStates.ERROR]: i18n.t('screens.proxiwash.modal.error'),
|
||||
[MachineStates.UNKNOWN]: i18n.t('screens.proxiwash.modal.unknown'),
|
||||
};
|
||||
|
||||
modalRef: null | Modalize;
|
||||
|
||||
fetchedData: {
|
||||
|
|
@ -205,7 +205,7 @@ class ProxiwashScreen extends React.Component<PropsType, StateType> {
|
|||
icon: '',
|
||||
onPress: () => undefined,
|
||||
};
|
||||
let message = this.modalStateStrings[item.state];
|
||||
let message = modalStateStrings[item.state];
|
||||
const onPress = () => this.onSetupNotificationsPress(item);
|
||||
if (item.state === MachineStates.RUNNING) {
|
||||
let remainingTime = parseInt(item.remainingTime, 10);
|
||||
|
|
|
|||
Loading…
Reference in a new issue