Browse Source

Display clubs the user is a manager of in first

Arnaud Vergnet 4 years ago
parent
commit
8563fea835
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      src/screens/Amicale/ProfileScreen.js

+ 3
- 0
src/screens/Amicale/ProfileScreen.js View File

@@ -269,6 +269,8 @@ class ProfileScreen extends React.Component<Props, State> {
269 269
 
270 270
     clubKeyExtractor = (item: Object) => item.name;
271 271
 
272
+    sortClubList = (a: Object, b: Object) => a.is_manager ? -1 : 1;
273
+
272 274
     /**
273 275
      * Renders the list of clubs the user is part of
274 276
      *
@@ -276,6 +278,7 @@ class ProfileScreen extends React.Component<Props, State> {
276 278
      * @return {*}
277 279
      */
278 280
     getClubList(list: Array<Object>) {
281
+        list.sort(this.sortClubList);
279 282
         return (
280 283
             //$FlowFixMe
281 284
             <FlatList

Loading…
Cancel
Save