diff --git a/src/screens/Users/Users.tsx b/src/screens/Users/Users.tsx index 72acba5b5c..8087a7ce20 100644 --- a/src/screens/Users/Users.tsx +++ b/src/screens/Users/Users.tsx @@ -227,7 +227,9 @@ const Users = (): JSX.Element => { }; const handleSorting = (option: string): void => { - setDisplayedUsers([]); + if (sortingOption !== option) { + setDisplayedUsers([]); + } setHasMore(true); setSortingOption(option); }; @@ -256,7 +258,9 @@ const Users = (): JSX.Element => { }; const handleFiltering = (option: string): void => { - setDisplayedUsers([]); + if (filteringOption !== option) { + setDisplayedUsers([]); + } setFilteringOption(option); }; @@ -414,63 +418,57 @@ const Users = (): JSX.Element => { ) : (
- {isLoading ? ( - - ) : ( - - } - hasMore={hasMore} - className={styles.listBox} - data-testid="users-list" - endMessage={ -
-
{tCommon('endOfResults')}
-
- } - > - - - - {headerTitles.map((title: string, index: number) => { + + } + hasMore={hasMore} + className={styles.listBox} + data-testid="users-list" + endMessage={ +
+
{tCommon('endOfResults')}
+
+ } + > +
+ + + {headerTitles.map((title: string, index: number) => { + return ( + + ); + })} + + + + {usersData && + displayedUsers.map( + (user: InterfaceQueryUserListItem, index: number) => { return ( - + ); - })} - - - - {usersData && - displayedUsers.map( - (user: InterfaceQueryUserListItem, index: number) => { - return ( - - ); - }, - )} - -
+ {title} +
- {title} -
-
- )} + }, + )} + + +
)}