diff options
author | Vitaly Takmazov | 2022-10-31 22:48:30 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:58 +0300 |
commit | 8887e1b51565b992f34c955c459125eb85b28483 (patch) | |
tree | 7fc8130f523014864e2d60aa9628e7a7ee7e7dd5 /vnext/src/ui/Message.js | |
parent | fc96a9a206a825171da87a7f23cc2ea16b1d645d (diff) |
`useVisitor` hook
Diffstat (limited to 'vnext/src/ui/Message.js')
-rw-r--r-- | vnext/src/ui/Message.js | 5 |
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'; |