1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

fixed node actions

This commit is contained in:
Fedor Katurov 2022-01-02 18:05:52 +07:00
parent e8effb92f1
commit 0bc2ff250f
13 changed files with 107 additions and 201 deletions

View file

@ -9,12 +9,12 @@ import { useImageModal } from '~/utils/hooks/useImageModal';
import { useNodeComments } from '~/utils/hooks/node/useNodeComments';
import { useBoris } from '~/utils/hooks/boris/useBoris';
import { NodeContextProvider } from '~/utils/context/NodeContextProvider';
import { useGetNode } from '~/utils/hooks/data/useGetNode';
const BorisPage: VFC = () => {
const dispatch = useDispatch();
const { node, isLoading, update } = useGetNode(696);
const {
current,
is_loading,
comments,
comment_count: count,
is_loading_comments: isLoadingComments,
@ -28,7 +28,7 @@ const BorisPage: VFC = () => {
}, [dispatch]);
return (
<NodeContextProvider node={current} isLoading={is_loading}>
<NodeContextProvider node={node} isLoading={isLoading} update={update}>
<CommentContextProvider
comments={comments}
count={count}

View file

@ -21,7 +21,7 @@ const NodePage: FC<Props> = ({
params: { id },
},
}) => {
const { node, isLoading } = useGetNode(parseInt(id, 10));
const { node, isLoading, update } = useGetNode(parseInt(id, 10));
const { isLoadingComments, comments, commentsCount, lastSeenCurrent } = useFullNode(id);
const onShowImageModal = useImageModal();
@ -40,7 +40,7 @@ const NodePage: FC<Props> = ({
}
return (
<NodeContextProvider node={node} isLoading={isLoading}>
<NodeContextProvider node={node} isLoading={isLoading} update={update}>
<NodeRelatedProvider id={parseInt(id, 10)} tags={node.tags}>
<CommentContextProvider
comments={comments}