mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
fixed boris form on SSR
This commit is contained in:
parent
e465f72034
commit
165aa0e88d
2 changed files with 11 additions and 1 deletions
|
@ -4,12 +4,15 @@ import { Group } from '~/components/containers/Group';
|
|||
import { Footer } from '~/components/main/Footer';
|
||||
import { NodeCommentForm } from '~/components/node/NodeCommentForm';
|
||||
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 { useNodeContext } from '~/utils/context/NodeContextProvider';
|
||||
import { useUserContext } from '~/utils/context/UserContextProvider';
|
||||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
interface IProps {}
|
||||
|
||||
const BorisComments: FC<IProps> = () => {
|
||||
|
@ -38,7 +41,9 @@ const BorisComments: FC<IProps> = () => {
|
|||
isLoading={isLoading}
|
||||
>
|
||||
<Group>
|
||||
{isUser && <NodeCommentForm user={user} nodeId={node.id} saveComment={onSaveComment} />}
|
||||
{(isUser || isSSR) && (
|
||||
<NodeCommentForm user={user} nodeId={node.id} saveComment={onSaveComment} />
|
||||
)}
|
||||
|
||||
{isLoading || !comments?.length ? (
|
||||
<NodeNoComments is_loading count={7} />
|
||||
|
@ -46,6 +51,8 @@ const BorisComments: FC<IProps> = () => {
|
|||
<NodeComments order="ASC" />
|
||||
)}
|
||||
|
||||
{comments?.length && <NodeComments order="ASC" />}
|
||||
|
||||
<Footer />
|
||||
</Group>
|
||||
</CommentContextProvider>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue