mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36: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 { Footer } from '~/components/main/Footer';
|
||||||
import { NodeCommentForm } from '~/components/node/NodeCommentForm';
|
import { NodeCommentForm } from '~/components/node/NodeCommentForm';
|
||||||
import { NodeNoComments } from '~/components/node/NodeNoComments';
|
import { NodeNoComments } from '~/components/node/NodeNoComments';
|
||||||
|
import { isSSR } from '~/constants/ssr';
|
||||||
import { NodeComments } from '~/containers/node/NodeComments';
|
import { NodeComments } from '~/containers/node/NodeComments';
|
||||||
import { useAuth } from '~/hooks/auth/useAuth';
|
import { useAuth } from '~/hooks/auth/useAuth';
|
||||||
import { CommentContextProvider, useCommentContext } from '~/utils/context/CommentContextProvider';
|
import { CommentContextProvider, useCommentContext } from '~/utils/context/CommentContextProvider';
|
||||||
import { useNodeContext } from '~/utils/context/NodeContextProvider';
|
import { useNodeContext } from '~/utils/context/NodeContextProvider';
|
||||||
import { useUserContext } from '~/utils/context/UserContextProvider';
|
import { useUserContext } from '~/utils/context/UserContextProvider';
|
||||||
|
|
||||||
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {}
|
interface IProps {}
|
||||||
|
|
||||||
const BorisComments: FC<IProps> = () => {
|
const BorisComments: FC<IProps> = () => {
|
||||||
|
@ -38,7 +41,9 @@ const BorisComments: FC<IProps> = () => {
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
>
|
>
|
||||||
<Group>
|
<Group>
|
||||||
{isUser && <NodeCommentForm user={user} nodeId={node.id} saveComment={onSaveComment} />}
|
{(isUser || isSSR) && (
|
||||||
|
<NodeCommentForm user={user} nodeId={node.id} saveComment={onSaveComment} />
|
||||||
|
)}
|
||||||
|
|
||||||
{isLoading || !comments?.length ? (
|
{isLoading || !comments?.length ? (
|
||||||
<NodeNoComments is_loading count={7} />
|
<NodeNoComments is_loading count={7} />
|
||||||
|
@ -46,6 +51,8 @@ const BorisComments: FC<IProps> = () => {
|
||||||
<NodeComments order="ASC" />
|
<NodeComments order="ASC" />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{comments?.length && <NodeComments order="ASC" />}
|
||||||
|
|
||||||
<Footer />
|
<Footer />
|
||||||
</Group>
|
</Group>
|
||||||
</CommentContextProvider>
|
</CommentContextProvider>
|
||||||
|
|
3
src/containers/boris/BorisComments/styles.module.scss
Normal file
3
src/containers/boris/BorisComments/styles.module.scss
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
.form {}
|
||||||
|
|
||||||
|
.comments {}
|
Loading…
Add table
Add a link
Reference in a new issue