Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3749297
D9498.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D9498.diff
View Options
diff --git a/web/modals/user-profile/user-profile-avatar-modal.react.js b/web/modals/user-profile/user-profile-avatar-modal.react.js
new file mode 100644
--- /dev/null
+++ b/web/modals/user-profile/user-profile-avatar-modal.react.js
@@ -0,0 +1,27 @@
+// @flow
+
+import * as React from 'react';
+
+import UserAvatar from '../../avatars/user-avatar.react.js';
+import FullScreenViewModal from '../full-screen-view-modal.react.js';
+
+type Props = {
+ +userID: ?string,
+};
+
+function UserProfileAvatarModal(props: Props): React.Node {
+ const { userID } = props;
+
+ const userProfileAvatarModal = React.useMemo(
+ () => (
+ <FullScreenViewModal>
+ <UserAvatar size="XXL" userID={userID} />
+ </FullScreenViewModal>
+ ),
+ [userID],
+ );
+
+ return userProfileAvatarModal;
+}
+
+export default UserProfileAvatarModal;
diff --git a/web/modals/user-profile/user-profile.css b/web/modals/user-profile/user-profile.css
--- a/web/modals/user-profile/user-profile.css
+++ b/web/modals/user-profile/user-profile.css
@@ -10,6 +10,10 @@
margin-bottom: 24px;
}
+.userAvatarContainer:hover {
+ cursor: pointer;
+}
+
.usernameContainer {
padding-left: 16px;
}
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
@@ -2,6 +2,7 @@
import * as React from 'react';
+import { useModalContext } from 'lib/components/modal-provider.react.js';
import SWMansionIcon from 'lib/components/SWMansionIcon.react.js';
import { relationshipBlockedInEitherDirection } from 'lib/shared/relationship-utils.js';
import { stringForUserExplicit } from 'lib/shared/user-utils.js';
@@ -10,6 +11,7 @@
import sleep from 'lib/utils/sleep.js';
import UserProfileActionButtons from './user-profile-action-buttons.react.js';
+import UserProfileAvatarModal from './user-profile-avatar-modal.react.js';
import css from './user-profile.css';
import UserAvatar from '../../avatars/user-avatar.react.js';
@@ -21,10 +23,16 @@
function UserProfile(props: Props): React.Node {
const { userInfo, userProfileThreadInfo } = props;
+ const { pushModal } = useModalContext();
+
const usernameText = stringForUserExplicit(userInfo);
const [usernameCopied, setUsernameCopied] = React.useState<boolean>(false);
+ const onClickUserAvatar = React.useCallback(() => {
+ pushModal(<UserProfileAvatarModal userID={userInfo?.id} />);
+ }, [pushModal, userInfo?.id]);
+
const onClickCopyUsername = React.useCallback(async () => {
if (usernameCopied) {
return;
@@ -53,7 +61,9 @@
() => (
<div className={css.container}>
<div className={css.userInfoContainer}>
- <UserAvatar userID={userInfo?.id} size="L" />
+ <div className={css.userAvatarContainer} onClick={onClickUserAvatar}>
+ <UserAvatar userID={userInfo?.id} size="L" />
+ </div>
<div className={css.usernameContainer}>
<div className={css.usernameText}>{usernameText}</div>
<div
@@ -76,6 +86,7 @@
[
actionButtons,
onClickCopyUsername,
+ onClickUserAvatar,
userInfo?.id,
usernameCopied,
usernameText,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 10, 9:12 PM (18 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2855400
Default Alt Text
D9498.diff (3 KB)
Attached To
Mode
D9498: [web] introduce UserProfileAvatarModal
Attached
Detach File
Event Timeline
Log In to Comment