Display clubs the user is a manager of in first

This commit is contained in:
Arnaud Vergnet 2020-04-10 00:37:51 +02:00
parent ebbd4df591
commit 8563fea835

View file

@ -269,6 +269,8 @@ class ProfileScreen extends React.Component<Props, State> {
clubKeyExtractor = (item: Object) => item.name; 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 * Renders the list of clubs the user is part of
* *
@ -276,6 +278,7 @@ class ProfileScreen extends React.Component<Props, State> {
* @return {*} * @return {*}
*/ */
getClubList(list: Array<Object>) { getClubList(list: Array<Object>) {
list.sort(this.sortClubList);
return ( return (
//$FlowFixMe //$FlowFixMe
<FlatList <FlatList