Page MenuHomePhabricator

D9431.id32066.diff
No OneTemporary

D9431.id32066.diff

diff --git a/web/modals/user-profile/user-profile-action-buttons.react.js b/web/modals/user-profile/user-profile-action-buttons.react.js
new file mode 100644
--- /dev/null
+++ b/web/modals/user-profile/user-profile-action-buttons.react.js
@@ -0,0 +1,29 @@
+// @flow
+
+import * as React from 'react';
+
+import type { ThreadInfo } from 'lib/types/thread-types';
+
+import UserProfileMessageButton from './user-profile-message-button.react.js';
+import css from './user-profile.css';
+
+type Props = {
+ +threadInfo: ThreadInfo,
+};
+
+function UserProfileActionButtons(props: Props): React.Node {
+ const { threadInfo } = props;
+
+ const userProfileActionButtons = React.useMemo(
+ () => (
+ <div className={css.buttonsContainer}>
+ <UserProfileMessageButton threadInfo={threadInfo} />
+ </div>
+ ),
+ [threadInfo],
+ );
+
+ return userProfileActionButtons;
+}
+
+export default UserProfileActionButtons;
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
@@ -9,7 +9,7 @@
import type { UserInfo } from 'lib/types/user-types';
import sleep from 'lib/utils/sleep.js';
-import UserProfileMessageButton from './user-profile-message-button.react.js';
+import UserProfileActionButtons from './user-profile-action-buttons.react.js';
import css from './user-profile.css';
import UserAvatar from '../../avatars/user-avatar.react.js';
@@ -37,7 +37,7 @@
setUsernameCopied(false);
}, [usernameCopied, usernameText]);
- const messageButton = React.useMemo(() => {
+ const actionButtons = React.useMemo(() => {
if (
!userProfileThreadInfo ||
relationshipBlockedInEitherDirection(userInfo?.relationshipStatus)
@@ -46,7 +46,7 @@
}
return (
- <UserProfileMessageButton threadInfo={userProfileThreadInfo.threadInfo} />
+ <UserProfileActionButtons threadInfo={userProfileThreadInfo.threadInfo} />
);
}, [userInfo?.relationshipStatus, userProfileThreadInfo]);
@@ -71,11 +71,11 @@
</div>
</div>
</div>
- <div className={css.buttonsContainer}>{messageButton}</div>
+ {actionButtons}
</div>
),
[
- messageButton,
+ actionButtons,
onClickCopyUsername,
userInfo?.id,
usernameCopied,

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 24, 11:32 AM (2 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2696942
Default Alt Text
D9431.id32066.diff (2 KB)

Event Timeline