Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32160034
D10419.1765040030.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
D10419.1765040030.diff
View Options
diff --git a/web/chat/reaction-tooltip.react.js b/web/chat/reaction-tooltip.react.js
--- a/web/chat/reaction-tooltip.react.js
+++ b/web/chat/reaction-tooltip.react.js
@@ -3,6 +3,7 @@
import * as React from 'react';
import { useModalContext } from 'lib/components/modal-provider.react.js';
+import { useENSNames } from 'lib/hooks/ens-cache.js';
import type { ReactionInfo } from 'lib/selectors/chat-selectors';
import {
@@ -14,6 +15,8 @@
import css from './reaction-tooltip.css';
import MessageReactionsModal from '../modals/chat/message-reactions-modal.react.js';
+const useENSNamesOptions = { allAtOnce: true };
+
type Props = {
+reactions: ReactionInfo,
+reaction: string,
@@ -21,6 +24,8 @@
function ReactionTooltip(props: Props): React.Node {
const { reactions, reaction } = props;
+ const { users } = reactions[reaction];
+
const { pushModal, popModal } = useModalContext();
const onClickReactionTooltip = React.useCallback(
@@ -34,10 +39,10 @@
[popModal, pushModal, reactions],
);
- const usernames = React.useMemo(() => {
- const { users } = reactions[reaction];
+ const resolvedUsers = useENSNames(users, useENSNamesOptions);
- return users.map(user => (
+ const usernames = React.useMemo(() => {
+ return resolvedUsers.map(user => (
<p
key={user.id}
className={css.usernameText}
@@ -46,7 +51,7 @@
{user.username}
</p>
));
- }, [reaction, reactions]);
+ }, [resolvedUsers]);
let seeMoreText;
if (usernames && usernames.length > 5) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 6, 4:53 PM (16 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5839676
Default Alt Text
D10419.1765040030.diff (1 KB)
Attached To
Mode
D10419: [web] ens resolve usernames in the reaction tooltip
Attached
Detach File
Event Timeline
Log In to Comment