Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32917549
D7208.1768215074.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D7208.1768215074.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
Mon, Jan 12, 10:51 AM (15 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5921707
Default Alt Text
D7208.1768215074.diff (1 KB)
Attached To
Mode
D7208: [web] render user avatars in typeahead tooltip
Attached
Detach File
Event Timeline
Log In to Comment