@@ -33,7 +27,6 @@
return (
void,
-};
-
-function FriendListModal(props: Props): React.Node {
- const { onClose } = props;
-
+function FriendListModal(): React.Node {
const { pushModal } = useModalContext();
+
const openNewFriendsModal = React.useCallback(() => {
- pushModal();
- }, [onClose, pushModal]);
+ pushModal();
+ }, [pushModal]);
return (
pushModal(),
- [popModal, pushModal],
+ () => pushModal(),
+ [pushModal],
);
const friendList = React.useMemo(
diff --git a/web/settings/relationship/user-list-modal.react.js b/web/settings/relationship/user-list-modal.react.js
--- a/web/settings/relationship/user-list-modal.react.js
+++ b/web/settings/relationship/user-list-modal.react.js
@@ -2,6 +2,7 @@
import * as React from 'react';
+import { useModalContext } from 'lib/components/modal-provider.react.js';
import type { AccountUserInfo, UserInfo } from 'lib/types/user-types.js';
import css from './user-list.css';
@@ -10,7 +11,6 @@
import SearchModal from '../../modals/search-modal.react.js';
type Props = {
- +onClose: () => void,
+name: string,
+userRowComponent: React.ComponentType,
+filterUser: (userInfo: UserInfo) => boolean,
@@ -21,7 +21,6 @@
function UserListModal(props: Props): React.Node {
const {
- onClose,
name,
userRowComponent,
filterUser,
@@ -30,6 +29,8 @@
onAddUsersClick,
} = props;
+ const { popModal } = useModalContext();
+
const searchModalChildGenerator = React.useCallback(
(searchText: string) => (
@@ -58,7 +59,7 @@
name={name}
size="large"
searchPlaceholder="Search by name"
- onClose={onClose}
+ onClose={popModal}
>
{searchModalChildGenerator}