mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
fixed comment loader animation
This commit is contained in:
parent
85f3de775a
commit
c30ecc1b81
4 changed files with 56 additions and 28 deletions
|
@ -17,27 +17,27 @@ const BorisComments: FC<IProps> = () => {
|
|||
const user = useUserContext();
|
||||
const { isUser } = useAuth();
|
||||
|
||||
const {
|
||||
isLoading,
|
||||
comments,
|
||||
onSaveComment,
|
||||
} = useCommentContext();
|
||||
const { isLoading, comments, onSaveComment } = useCommentContext();
|
||||
const { node } = useNodeContext();
|
||||
|
||||
return (
|
||||
<Group>
|
||||
{(isUser || isSSR) && (
|
||||
<NodeCommentFormSSR user={user} nodeId={node.id} saveComment={onSaveComment} />
|
||||
)}
|
||||
<Group>
|
||||
{(isUser || isSSR) && (
|
||||
<NodeCommentFormSSR
|
||||
user={user}
|
||||
nodeId={node.id}
|
||||
saveComment={onSaveComment}
|
||||
/>
|
||||
)}
|
||||
|
||||
{isLoading || !comments?.length ? (
|
||||
<NodeNoComments is_loading count={7} />
|
||||
) : (
|
||||
<NodeComments order="ASC" />
|
||||
)}
|
||||
{isLoading || !comments?.length ? (
|
||||
<NodeNoComments loading count={7} />
|
||||
) : (
|
||||
<NodeComments order="ASC" />
|
||||
)}
|
||||
|
||||
<Footer />
|
||||
</Group>
|
||||
<Footer />
|
||||
</Group>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -26,7 +26,11 @@ interface IProps {
|
|||
const NodeBottomBlock: FC<IProps> = ({ commentsOrder }) => {
|
||||
const user = useUserContext();
|
||||
const { node, isLoading } = useNodeContext();
|
||||
const { comments, isLoading: isLoadingComments, onSaveComment } = useCommentContext();
|
||||
const {
|
||||
comments,
|
||||
isLoading: isLoadingComments,
|
||||
onSaveComment,
|
||||
} = useCommentContext();
|
||||
const { related, isLoading: isLoadingRelated } = useNodeRelatedContext();
|
||||
const { inline } = useNodeBlocks(node, isLoading);
|
||||
const { isUser } = useAuthProvider();
|
||||
|
@ -43,15 +47,21 @@ const NodeBottomBlock: FC<IProps> = ({ commentsOrder }) => {
|
|||
{inline && <div className={styles.inline}>{inline}</div>}
|
||||
|
||||
<article>
|
||||
{isLoading || isLoadingComments || (!comments.length && !inline) ? (
|
||||
<NodeNoComments is_loading={isLoadingComments || isLoading} />
|
||||
{isLoading ||
|
||||
isLoadingComments ||
|
||||
(!comments.length && !inline) ? (
|
||||
<NodeNoComments loading={isLoadingComments || isLoading} />
|
||||
) : (
|
||||
<NodeComments order={commentsOrder} />
|
||||
)}
|
||||
</article>
|
||||
|
||||
{isUser && !isLoading && (
|
||||
<NodeCommentFormSSR nodeId={node.id} saveComment={onSaveComment} user={user} />
|
||||
<NodeCommentFormSSR
|
||||
nodeId={node.id}
|
||||
saveComment={onSaveComment}
|
||||
user={user}
|
||||
/>
|
||||
)}
|
||||
</Group>
|
||||
|
||||
|
@ -66,7 +76,11 @@ const NodeBottomBlock: FC<IProps> = ({ commentsOrder }) => {
|
|||
<NodeTagsBlock />
|
||||
</div>
|
||||
<div className={styles.left_item}>
|
||||
<NodeRelatedBlock isLoading={isLoadingRelated} node={node} related={related} />
|
||||
<NodeRelatedBlock
|
||||
isLoading={isLoadingRelated}
|
||||
node={node}
|
||||
related={related}
|
||||
/>
|
||||
</div>
|
||||
</Sticky>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue