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 }}>