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

removed almost all node sagas

This commit is contained in:
Fedor Katurov 2022-01-02 20:44:41 +07:00
parent f76a5a4798
commit 168ba8cc04
30 changed files with 268 additions and 448 deletions

View file

@ -1,37 +1,32 @@
import React, { useEffect, VFC } from 'react';
import { useDispatch } from 'react-redux';
import { useShallowSelect } from '~/hooks/data/useShallowSelect';
import { selectNode } from '~/redux/node/selectors';
import React, { VFC } from 'react';
import { BorisLayout } from '~/layouts/BorisLayout';
import { nodeLoadNode } from '~/redux/node/actions';
import { CommentContextProvider } from '~/utils/context/CommentContextProvider';
import { useImageModal } from '~/hooks/navigation/useImageModal';
import { useNodeComments } from '~/hooks/node/useNodeComments';
import { useNodeComments } from '~/hooks/comments/useNodeComments';
import { useBoris } from '~/hooks/boris/useBoris';
import { NodeContextProvider } from '~/utils/context/NodeContextProvider';
import { useGetNode } from '~/hooks/node/useGetNode';
import { useLoadNode } from '~/hooks/node/useLoadNode';
const BorisPage: VFC = () => {
const dispatch = useDispatch();
const { node, isLoading, update } = useGetNode(696);
const {
comments,
comment_count: count,
is_loading_comments: isLoadingComments,
} = useShallowSelect(selectNode);
const { node, isLoading, update } = useLoadNode(696);
const onShowImageModal = useImageModal();
const { onLoadMoreComments, onDelete: onDeleteComment } = useNodeComments(696);
const {
onLoadMoreComments,
onDelete: onDeleteComment,
onEdit: onSaveComment,
comments,
hasMore,
isLoading: isLoadingComments,
} = useNodeComments(696);
const { title, setIsBetaTester, isTester, stats } = useBoris(comments);
useEffect(() => {
dispatch(nodeLoadNode(696, 'DESC'));
}, [dispatch]);
return (
<NodeContextProvider node={node} isLoading={isLoading} update={update}>
<CommentContextProvider
onSaveComment={onSaveComment}
comments={comments}
count={count}
hasMore={hasMore}
isLoading={isLoadingComments}
onShowImageModal={onShowImageModal}
onLoadMoreComments={onLoadMoreComments}