From 8887e1b51565b992f34c955c459125eb85b28483 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 31 Oct 2022 22:48:30 +0300 Subject: `useVisitor` hook --- vnext/src/ui/Post.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'vnext/src/ui/Post.js') diff --git a/vnext/src/ui/Post.js b/vnext/src/ui/Post.js index a1d14ea0..51c25a19 100644 --- a/vnext/src/ui/Post.js +++ b/vnext/src/ui/Post.js @@ -7,13 +7,15 @@ import Button from './Button'; import MessageInput from './MessageInput'; import { post, update } from '../api'; +import { useVisitor } from './VisitorContext'; /** - * @param {{visitor: import('../api').User}} props + * */ -export default function Post({ visitor }) { +export default function Post() { const location = useLocation(); const navigate = useNavigate(); + const [visitor] = useVisitor(); let draftMessage = (location.state || {}).draft || {}; let [draft, setDraft] = useState(draftMessage.body); let params = qs.parse(window.location.search.substring(1)); -- cgit v1.2.3