aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui/Message.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/src/ui/Message.js')
-rw-r--r--vnext/src/ui/Message.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/vnext/src/ui/Message.js b/vnext/src/ui/Message.js
index dd6fc0ce..37d74312 100644
--- a/vnext/src/ui/Message.js
+++ b/vnext/src/ui/Message.js
@@ -8,11 +8,11 @@ import Avatar from './Avatar';
import { UserLink } from './UserInfo';
import { format, embedUrls } from '../utils/embed';
+import { useVisitor } from './VisitorContext';
/**
* @typedef {object} MessageProps
* @property { import('../client').Message } data data
- * @property { import('../client').SecureUser } visitor visitor
*/
/**
@@ -20,7 +20,8 @@ import { format, embedUrls } from '../utils/embed';
*
* @param {React.PropsWithChildren<{}> & MessageProps} props props
*/
-export default function Message({ visitor, data, children }) {
+export default function Message({ data, children }) {
+ const [visitor] = useVisitor();
const isCode = (data.tags || []).indexOf('code') >= 0;
const likesSummary = data.likes ? `${data.likes}` : 'Recommend';
const commentsSummary = data.replies ? `${data.replies}` : 'Comment';