Page MenuHomePhabricator

D9409.id.diff
No OneTemporary

D9409.id.diff

diff --git a/web/modals/user-profile/user-profile.css b/web/modals/user-profile/user-profile.css
new file mode 100644
--- /dev/null
+++ b/web/modals/user-profile/user-profile.css
@@ -0,0 +1,33 @@
+.container {
+ display: flex;
+ align-items: center;
+ padding: 0 32px 32px;
+ width: 552px;
+ max-width: 80vw;
+}
+
+.usernameContainer {
+ padding-left: 16px;
+}
+
+.usernameText {
+ font-size: var(--xxl-font-24);
+ color: var(--fg);
+ font-weight: 500;
+}
+
+.copyUsernameContainer {
+ display: flex;
+ align-items: center;
+ color: var(--purple-link);
+ margin-top: 8px;
+}
+
+.copyUsernameContainer:hover {
+ cursor: pointer;
+}
+
+.copyUsernameText {
+ font-size: var(--xs-font-12);
+ margin-left: 4px;
+}
diff --git a/web/modals/user-profile/user-profile.react.js b/web/modals/user-profile/user-profile.react.js
new file mode 100644
--- /dev/null
+++ b/web/modals/user-profile/user-profile.react.js
@@ -0,0 +1,40 @@
+// @flow
+
+import * as React from 'react';
+
+import SWMansionIcon from 'lib/components/SWMansionIcon.react.js';
+import { stringForUserExplicit } from 'lib/shared/user-utils.js';
+import type { UserInfo } from 'lib/types/user-types';
+
+import css from './user-profile.css';
+import UserAvatar from '../../avatars/user-avatar.react.js';
+
+type Props = {
+ +userInfo: ?UserInfo,
+};
+
+function UserProfile(props: Props): React.Node {
+ const { userInfo } = props;
+
+ const usernameText = stringForUserExplicit(userInfo);
+
+ const userProfile = React.useMemo(
+ () => (
+ <div className={css.container}>
+ <UserAvatar userID={userInfo?.id} size="L" />
+ <div className={css.usernameContainer}>
+ <div className={css.usernameText}>{usernameText}</div>
+ <div className={css.copyUsernameContainer}>
+ <SWMansionIcon icon="copy" size={16} />
+ <p className={css.copyUsernameText}>Copy username</p>
+ </div>
+ </div>
+ </div>
+ ),
+ [userInfo?.id, usernameText],
+ );
+
+ return userProfile;
+}
+
+export default UserProfile;

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 10:43 PM (15 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2696940
Default Alt Text
D9409.id.diff (2 KB)

Event Timeline