diff --git a/web/modals/user-profile/user-profile-modal.react.js b/web/modals/user-profile/user-profile-modal.react.js
--- a/web/modals/user-profile/user-profile-modal.react.js
+++ b/web/modals/user-profile/user-profile-modal.react.js
@@ -3,8 +3,10 @@
import * as React from 'react';
import { useModalContext } from 'lib/components/modal-provider.react.js';
+import { useUserProfileThreadInfo } from 'lib/shared/thread-utils.js';
import type { UserInfo } from 'lib/types/user-types.js';
+import UserProfileMenu from './user-profile-menu.react.js';
import UserProfile from './user-profile.react.js';
import { useSelector } from '../../redux/redux-utils.js';
import Modal from '../modal.react.js';
@@ -22,9 +24,25 @@
state => state.userStore.userInfos[userID],
);
+ const userProfileThreadInfo = useUserProfileThreadInfo(userInfo);
+
+ const menuButton = React.useMemo(() => {
+ if (!userProfileThreadInfo) {
+ return null;
+ }
+ return ;
+ }, [userProfileThreadInfo]);
+
return (
-
-
+
+
);
}
diff --git a/web/modals/user-profile/user-profile.react.js b/web/modals/user-profile/user-profile.react.js
--- a/web/modals/user-profile/user-profile.react.js
+++ b/web/modals/user-profile/user-profile.react.js
@@ -4,8 +4,8 @@
import SWMansionIcon from 'lib/components/SWMansionIcon.react.js';
import { relationshipBlockedInEitherDirection } from 'lib/shared/relationship-utils.js';
-import { useUserProfileThreadInfo } from 'lib/shared/thread-utils.js';
import { stringForUserExplicit } from 'lib/shared/user-utils.js';
+import type { UserProfileThreadInfo } from 'lib/types/thread-types';
import type { UserInfo } from 'lib/types/user-types';
import sleep from 'lib/utils/sleep.js';
@@ -15,12 +15,11 @@
type Props = {
+userInfo: ?UserInfo,
+ +userProfileThreadInfo: ?UserProfileThreadInfo,
};
function UserProfile(props: Props): React.Node {
- const { userInfo } = props;
-
- const userProfileThreadInfo = useUserProfileThreadInfo(userInfo);
+ const { userInfo, userProfileThreadInfo } = props;
const usernameText = stringForUserExplicit(userInfo);