Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3267099
D9431.id32066.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D9431.id32066.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 2:33 AM (6 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2510931
Default Alt Text
D9431.id32066.diff (2 KB)
Attached To
Mode
D9431: [web] introduce UserProfileActionButtons
Attached
Detach File
Event Timeline
Log In to Comment