mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
add comments for guests
This commit is contained in:
parent
cbf7b1f616
commit
8abf6177b5
16 changed files with 278 additions and 194 deletions
|
@ -1,34 +1,20 @@
|
|||
import React, { FC } from 'react';
|
||||
import { FC } from 'react';
|
||||
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import { Footer } from '~/components/main/Footer';
|
||||
import { NodeCommentFormSSR } from '~/components/node/NodeCommentForm/ssr';
|
||||
import { NodeNoComments } from '~/components/node/NodeNoComments';
|
||||
import { isSSR } from '~/constants/ssr';
|
||||
import { NodeCommentFormSSR } from '~/containers/node/NodeCommentForm/ssr';
|
||||
import { NodeComments } from '~/containers/node/NodeComments';
|
||||
import { useAuth } from '~/hooks/auth/useAuth';
|
||||
import { useCommentContext } from '~/utils/context/CommentContextProvider';
|
||||
import { useNodeContext } from '~/utils/context/NodeContextProvider';
|
||||
import { useUserContext } from '~/utils/context/UserContextProvider';
|
||||
|
||||
interface IProps {}
|
||||
|
||||
const BorisComments: FC<IProps> = () => {
|
||||
const user = useUserContext();
|
||||
const { isUser } = useAuth();
|
||||
interface Props {}
|
||||
|
||||
const BorisComments: FC<Props> = () => {
|
||||
const { isLoading, comments, onSaveComment } = useCommentContext();
|
||||
const { node } = useNodeContext();
|
||||
|
||||
return (
|
||||
<Group>
|
||||
{(isUser || isSSR) && (
|
||||
<NodeCommentFormSSR
|
||||
user={user}
|
||||
nodeId={node.id}
|
||||
saveComment={onSaveComment}
|
||||
/>
|
||||
)}
|
||||
<NodeCommentFormSSR saveComment={onSaveComment} />
|
||||
|
||||
{isLoading || !comments?.length ? (
|
||||
<NodeNoComments loading count={7} />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue