From 8563fea835296be0bea33cbd7d0e27183a8358b4 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Fri, 10 Apr 2020 00:37:51 +0200 Subject: [PATCH] Display clubs the user is a manager of in first --- src/screens/Amicale/ProfileScreen.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/screens/Amicale/ProfileScreen.js b/src/screens/Amicale/ProfileScreen.js index 4f029dc..6224f17 100644 --- a/src/screens/Amicale/ProfileScreen.js +++ b/src/screens/Amicale/ProfileScreen.js @@ -269,6 +269,8 @@ class ProfileScreen extends React.Component { clubKeyExtractor = (item: Object) => item.name; + sortClubList = (a: Object, b: Object) => a.is_manager ? -1 : 1; + /** * Renders the list of clubs the user is part of * @@ -276,6 +278,7 @@ class ProfileScreen extends React.Component { * @return {*} */ getClubList(list: Array) { + list.sort(this.sortClubList); return ( //$FlowFixMe