Page MenuHomePhabricator

D10747.id37192.diff
No OneTemporary

D10747.id37192.diff

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 (
+ <Button
+ variant="text"
+ buttonColor={clearAllButtonColor}
+ onClick={onClickClearAll}
+ disabled={pendingUsersToAdd.size === 0}
+ >
+ Clear all
+ </Button>
+ );
+ }, [
+ 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 (
<div className={css.listHeaderContainer}>
<div className={css.selectionText}>{selectionText}</div>
- <Button
- variant="text"
- buttonColor={clearAllButtonColor}
- onClick={onClickClearAll}
- disabled={pendingUsersToAdd.size === 0}
- >
- Clear all
- </Button>
+ {clearAllButton}
</div>
);
- }, [clearAllButtonColor, onClickClearAll, pendingUsersToAdd.size]);
+ }, [clearAllButton, pendingUsersToAdd.size, searchText.length]);
let errors;
if (errorMessage) {

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 9:37 PM (21 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2535753
Default Alt Text
D10747.id37192.diff (1 KB)

Event Timeline