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/Comment.js | |
parent | fc96a9a206a825171da87a7f23cc2ea16b1d645d (diff) |
`useVisitor` hook
Diffstat (limited to 'vnext/src/ui/Comment.js')
-rw-r--r-- | vnext/src/ui/Comment.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vnext/src/ui/Comment.js b/vnext/src/ui/Comment.js index 756b3487..45c80187 100644 --- a/vnext/src/ui/Comment.js +++ b/vnext/src/ui/Comment.js @@ -9,6 +9,7 @@ import MessageInput from './MessageInput'; import { fetchUserUri } from '../api'; import { chatItemStyle } from './helpers/BubbleStyle'; import { format, embedUrls } from '../utils/embed'; +import { useVisitor } from './VisitorContext'; let isMounted; @@ -16,16 +17,16 @@ let isMounted; * @param {{ msg: import('../api').Message, draft: string, - visitor: import('../api').User, active: number, setActive: function, onStartEditing: function, postComment: function }} props */ -export default function Comment({ msg, draft, visitor, active, setActive, onStartEditing, postComment }) { +export default function Comment({ msg, draft, active, setActive, onStartEditing, postComment }) { const embedRef = useRef(); const msgRef = useRef(); + const [visitor] = useVisitor(); const [author, setAuthor] = useState(msg.user); useEffect(() => { if (msgRef.current) { |