Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3522735
D7208.id24627.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7208.id24627.diff
View Options
diff --git a/web/chat/typeahead-tooltip.css b/web/chat/typeahead-tooltip.css
--- a/web/chat/typeahead-tooltip.css
+++ b/web/chat/typeahead-tooltip.css
@@ -65,3 +65,7 @@
opacity: 1;
transition: opacity 100ms ease-in;
}
+
+span.username {
+ margin-left: 8px;
+}
diff --git a/web/utils/typeahead-utils.js b/web/utils/typeahead-utils.js
--- a/web/utils/typeahead-utils.js
+++ b/web/utils/typeahead-utils.js
@@ -12,6 +12,7 @@
import { typeaheadStyle } from '../chat/chat-constants.js';
import css from '../chat/typeahead-tooltip.css';
import Button from '../components/button.react.js';
+import UserAvatar from '../components/user-avatar.react.js';
const webTypeaheadRegex: RegExp = new RegExp(
`(?<textPrefix>(?:^(?:.|\n)*\\s+)|^)@(?<username>${oldValidUsernameRegexString})?$`,
@@ -20,7 +21,7 @@
export type TypeaheadTooltipAction = {
+key: string,
+execute: () => mixed,
- +actionButtonContent: React.Node,
+ +actionButtonContent: { +userID: string, +username: string },
};
export type TooltipPosition = {
@@ -112,7 +113,10 @@
inputStateSetDraft(newText);
inputStateSetTextCursorPosition(newSelectionStart);
},
- actionButtonContent: stringForUserExplicit(suggestedUser),
+ actionButtonContent: {
+ userID: suggestedUser.id,
+ username: stringForUserExplicit(suggestedUser),
+ },
}));
}
@@ -140,7 +144,8 @@
onMouseMove={onMouseMove}
className={buttonClasses}
>
- <span>@{actionButtonContent}</span>
+ <UserAvatar size="small" userID={actionButtonContent.userID} />
+ <span className={css.username}>@{actionButtonContent.username}</span>
</Button>
);
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 7:33 AM (19 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2698124
Default Alt Text
D7208.id24627.diff (1 KB)
Attached To
Mode
D7208: [web] render user avatars in typeahead tooltip
Attached
Detach File
Event Timeline
Log In to Comment