Page MenuHomePhabricator

D4574.diff
No OneTemporary

D4574.diff

diff --git a/web/modals/threads/members/add-members-group.react.js b/web/modals/threads/members/add-members-group.react.js
--- a/web/modals/threads/members/add-members-group.react.js
+++ b/web/modals/threads/members/add-members-group.react.js
@@ -8,7 +8,7 @@
import css from './members-modal.css';
type AddMemberItemGroupProps = {
- +header: string,
+ +header: ?string,
+userInfos: $ReadOnlyArray<UserListItem>,
+onUserClick: (userID: string) => void,
+usersAdded: $ReadOnlySet<string>,
@@ -32,10 +32,13 @@
)),
[onUserClick, sortedUserInfos, usersAdded],
);
+ const headerComponent = header ? (
+ <div className={css.addMemberItemsGroupHeader}>{header}:</div>
+ ) : null;
return (
<>
- <div className={css.addMemberItemsGroupHeader}>{header}:</div>
+ {headerComponent}
{userInfosComponents}
</>
);
diff --git a/web/modals/threads/members/add-members-list.react.js b/web/modals/threads/members/add-members-list.react.js
--- a/web/modals/threads/members/add-members-list.react.js
+++ b/web/modals/threads/members/add-members-list.react.js
@@ -12,10 +12,16 @@
+userListItems: $ReadOnlyArray<UserListItem>,
+pendingUsersToAdd: $ReadOnlySet<string>,
+switchUser: string => void,
+ +hasParentThread: boolean,
};
function AddMembersList(props: Props): React.Node {
- const { userListItems, pendingUsersToAdd, switchUser } = props;
+ const {
+ userListItems,
+ pendingUsersToAdd,
+ switchUser,
+ hasParentThread,
+ } = props;
const usersAvailableToAdd = React.useMemo(
() => userListItems.filter(user => !user.alertText),
@@ -27,13 +33,13 @@
[usersAvailableToAdd],
);
- const membersInParentThread = React.useMemo(
- () =>
- groupedAvailableUsersList['undefined']
- ? ['Users in parent channel', groupedAvailableUsersList['undefined']]
- : undefined,
- [groupedAvailableUsersList],
- );
+ const membersInParentThread = React.useMemo(() => {
+ if (!groupedAvailableUsersList['undefined']) {
+ return;
+ }
+ const label = hasParentThread ? 'Users in parent channel' : null;
+ return [label, groupedAvailableUsersList['undefined']];
+ }, [groupedAvailableUsersList, hasParentThread]);
const membersNotInParentThread = React.useMemo(
() =>
diff --git a/web/modals/threads/members/add-members-modal.react.js b/web/modals/threads/members/add-members-modal.react.js
--- a/web/modals/threads/members/add-members-modal.react.js
+++ b/web/modals/threads/members/add-members-modal.react.js
@@ -143,6 +143,7 @@
userListItems={userSearchResults}
switchUser={onSwitchUser}
pendingUsersToAdd={pendingUsersToAdd}
+ hasParentThread={!!threadInfo.parentThreadID}
/>
</div>
<div className={css.addMembersFooter}>

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 12:26 AM (21 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2581777
Default Alt Text
D4574.diff (2 KB)

Event Timeline