From 44294bb7ca0ae1c09b5b7076bc511597f1453888 Mon Sep 17 00:00:00 2001 From: keplyx Date: Sun, 6 Oct 2019 12:44:40 +0200 Subject: [PATCH] Fixed crash on menu screen + added french dashboard translation --- components/Sidebar.js | 2 +- screens/SelfMenuScreen.js | 9 +++------ translations/fr.json | 18 +++++++++++++++++- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/components/Sidebar.js b/components/Sidebar.js index e184ca5..972da25 100644 --- a/components/Sidebar.js +++ b/components/Sidebar.js @@ -71,7 +71,7 @@ export default class SideBar extends React.Component { } /** - * 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) { diff --git a/screens/SelfMenuScreen.js b/screens/SelfMenuScreen.js index b628b4d..1cb9c23 100644 --- a/screens/SelfMenuScreen.js +++ b/screens/SelfMenuScreen.js @@ -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 }}>