Page MenuHomePhabricator

D4311.diff
No OneTemporary

D4311.diff

diff --git a/web/settings/relationship/add-users-list-modal.react.js b/web/settings/relationship/add-users-list-modal.react.js
new file mode 100644
--- /dev/null
+++ b/web/settings/relationship/add-users-list-modal.react.js
@@ -0,0 +1,65 @@
+// @flow
+
+import * as React from 'react';
+
+import type {
+ UserRelationshipStatus,
+ RelationshipAction,
+} from 'lib/types/relationship-types.js';
+
+import type { ButtonVariant } from '../../components/button.react.js';
+import SearchModal from '../../modals/search-modal.react';
+import AddUsersList from './add-users-list.react.js';
+
+type Props = {
+ +closeModal: () => void,
+ +name: string,
+ +excludedStatuses: $ReadOnlySet<UserRelationshipStatus>,
+ +confirmButtonContent: React.Node,
+ +confirmButtonVariant?: ButtonVariant,
+ +relationshipAction: RelationshipAction,
+};
+
+function AddUsersListModal(props: Props): React.Node {
+ const {
+ closeModal,
+ name,
+ excludedStatuses,
+ confirmButtonContent,
+ confirmButtonVariant = 'primary',
+ relationshipAction,
+ } = props;
+
+ const addUsersListChildGenerator = React.useCallback(
+ (searchText: string) => (
+ <AddUsersList
+ searchText={searchText}
+ excludedStatuses={excludedStatuses}
+ confirmButtonContent={confirmButtonContent}
+ confirmButtonVariant={confirmButtonVariant}
+ relationshipAction={relationshipAction}
+ closeModal={closeModal}
+ />
+ ),
+ [
+ excludedStatuses,
+ confirmButtonContent,
+ confirmButtonVariant,
+ relationshipAction,
+ closeModal,
+ ],
+ );
+
+ return (
+ <SearchModal
+ name={name}
+ onClose={closeModal}
+ size="large"
+ searchPlaceholder="Search by name"
+ >
+ {addUsersListChildGenerator}
+ </SearchModal>
+ );
+}
+
+export default AddUsersListModal;

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 7:05 AM (20 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2675815
Default Alt Text
D4311.diff (1 KB)

Event Timeline