diff --git a/web/settings/relationship/add-users-list.react.js b/web/settings/relationship/add-users-list.react.js --- a/web/settings/relationship/add-users-list.react.js +++ b/web/settings/relationship/add-users-list.react.js @@ -133,26 +133,43 @@ return { color: 'var(--link-background-secondary-default)' }; }, [pendingUsersToAdd.size]); + const clearAllButton = React.useMemo(() => { + if (searchText.length > 0) { + return null; + } + + return ( + + ); + }, [ + clearAllButtonColor, + onClickClearAll, + pendingUsersToAdd.size, + searchText.length, + ]); + const listHeader = React.useMemo(() => { let selectionText = 'Select users'; - if (pendingUsersToAdd.size > 0) { + if (searchText.length > 0) { + selectionText = 'Search results:'; + } else if (pendingUsersToAdd.size > 0) { selectionText = `${pendingUsersToAdd.size} selected`; } return (