mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
fixed comments loader
This commit is contained in:
parent
0a1d2cbf99
commit
bb81bdae69
16 changed files with 80 additions and 127 deletions
|
@ -7,7 +7,7 @@ import { NodeNoComments } from '~/components/node/NodeNoComments';
|
|||
import { isSSR } from '~/constants/ssr';
|
||||
import { NodeComments } from '~/containers/node/NodeComments';
|
||||
import { useAuth } from '~/hooks/auth/useAuth';
|
||||
import { CommentContextProvider, useCommentContext } from '~/utils/context/CommentContextProvider';
|
||||
import { useCommentContext } from '~/utils/context/CommentContextProvider';
|
||||
import { useNodeContext } from '~/utils/context/NodeContextProvider';
|
||||
import { useUserContext } from '~/utils/context/UserContextProvider';
|
||||
|
||||
|
@ -21,23 +21,10 @@ const BorisComments: FC<IProps> = () => {
|
|||
isLoading,
|
||||
comments,
|
||||
onSaveComment,
|
||||
onLoadMoreComments,
|
||||
onDeleteComment,
|
||||
onShowImageModal,
|
||||
hasMore,
|
||||
} = useCommentContext();
|
||||
const { node } = useNodeContext();
|
||||
|
||||
return (
|
||||
<CommentContextProvider
|
||||
onSaveComment={onSaveComment}
|
||||
comments={comments}
|
||||
hasMore={hasMore}
|
||||
onDeleteComment={onDeleteComment}
|
||||
onLoadMoreComments={onLoadMoreComments}
|
||||
onShowImageModal={onShowImageModal}
|
||||
isLoading={isLoading}
|
||||
>
|
||||
<Group>
|
||||
{(isUser || isSSR) && (
|
||||
<NodeCommentFormSSR user={user} nodeId={node.id} saveComment={onSaveComment} />
|
||||
|
@ -51,7 +38,6 @@ const BorisComments: FC<IProps> = () => {
|
|||
|
||||
<Footer />
|
||||
</Group>
|
||||
</CommentContextProvider>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue