aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui/Post.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-10-31 22:48:30 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:58 +0300
commit8887e1b51565b992f34c955c459125eb85b28483 (patch)
tree7fc8130f523014864e2d60aa9628e7a7ee7e7dd5 /vnext/src/ui/Post.js
parentfc96a9a206a825171da87a7f23cc2ea16b1d645d (diff)
`useVisitor` hook
Diffstat (limited to 'vnext/src/ui/Post.js')
-rw-r--r--vnext/src/ui/Post.js6
1 files changed, 4 insertions, 2 deletions
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));