Fixed crash on menu screen + added french dashboard translation

This commit is contained in:
keplyx 2019-10-06 12:44:40 +02:00
parent 158973c74d
commit 44294bb7ca
3 changed files with 21 additions and 8 deletions

View file

@ -71,7 +71,7 @@ export default class SideBar extends React.Component<Props, State> {
}
/**
* Navigate to the selected route, close the drawer, and mark the correct item as selected
* Navigate to the selected route
* @param route {string} The route name to navigate to
*/
navigateToScreen(route: string) {

View file

@ -53,7 +53,7 @@ export default class SelfMenuScreen extends FetchedDataSectionList {
}
getKeyExtractor(item: Object) {
return item !== undefined ? item['date'] + '_' + item['name'] : undefined;
return item !== undefined ? item['name'] : undefined;
}
hasBackButton() {
@ -71,7 +71,7 @@ export default class SelfMenuScreen extends FetchedDataSectionList {
result = [
{
title: '',
data: {},
data: [],
extraData: super.state,
keyExtractor: this.getKeyExtractor
}
@ -79,10 +79,6 @@ export default class SelfMenuScreen extends FetchedDataSectionList {
}
// fetched data is an array here
for (let i = 0; i < fetchedData.length; i++) {
// Add the date to the item to allow creation of unique list id
for (let item of fetchedData[i].meal[0].foodcategory) {
item['date'] = fetchedData[i]['date'];
}
result.push(
{
title: this.getFormattedDate(fetchedData[i].date),
@ -109,6 +105,7 @@ export default class SelfMenuScreen extends FetchedDataSectionList {
marginRight: 10,
marginTop: 10,
marginBottom: 10,
borderRadius: 50
}}>
<H2 style={{
textAlign: 'center',

View file

@ -69,7 +69,23 @@
},
"homeScreen": {
"listUpdated": "List mise à jour!",
"listUpdateFail": "Erreur lors de la mise à jour de la liste"
"listUpdateFail": "Erreur lors de la mise à jour de la liste",
"newsFeed": "Nouvelles du campus",
"dashboard": {
"todayEventsTitle": "Événements aujourd'hui",
"todayEventsSubtitleNA": "Pas d'événements",
"todayEventsSubtitle": " événements aujourd'hui",
"proximoTitle": "Proximo",
"proximoSubtitleNA": "pas d'article en vente",
"proximoSubtitle": " articles disponibles",
"proxiwashTitle": "Machines disponibles",
"proxiwashSubtitleNA": "Pas de machine disponible",
"proxiwashSubtitle1": " sèches linges et ",
"proxiwashSubtitle2": " laves linges",
"menuTitle": "Menu d'aujourd'hui",
"menuSubtitleNA": "Pas de menu disponible",
"menuSubtitle": "Cliquez ici pour voir le menu"
}
},
"planningScreen": {
"wipTitle": "WORK IN PROGRESS",