Page MenuHomePhabricator

D9498.id32123.diff
No OneTemporary

D9498.id32123.diff

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

Mime Type
text/plain
Expires
Sat, Jan 11, 2:34 AM (19 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2855400
Default Alt Text
D9498.id32123.diff (3 KB)

Event Timeline