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
|
@ -1,6 +1,7 @@
|
|||
import React, { FC, memo, useMemo } from 'react';
|
||||
|
||||
import { Comment } from '~/components/comment/Comment';
|
||||
import { LoadMoreButton } from '~/components/input/LoadMoreButton';
|
||||
import { useGrouppedComments } from '~/hooks/node/useGrouppedComments';
|
||||
import { ICommentGroup } from '~/types';
|
||||
import { useCommentContext } from '~/utils/context/CommentContextProvider';
|
||||
|
@ -21,6 +22,8 @@ const NodeComments: FC<IProps> = memo(({ order }) => {
|
|||
const {
|
||||
comments,
|
||||
hasMore,
|
||||
isLoading,
|
||||
isLoadingMore,
|
||||
lastSeenCurrent,
|
||||
onLoadMoreComments,
|
||||
onDeleteComment,
|
||||
|
@ -36,12 +39,10 @@ const NodeComments: FC<IProps> = memo(({ order }) => {
|
|||
|
||||
const more = useMemo(
|
||||
() =>
|
||||
hasMore && (
|
||||
<div className={styles.more} onClick={onLoadMoreComments}>
|
||||
Показать ещё комментарии
|
||||
</div>
|
||||
),
|
||||
[hasMore, onLoadMoreComments]
|
||||
hasMore && <div className={styles.more}>
|
||||
<LoadMoreButton isLoading={isLoadingMore} onClick={onLoadMoreComments} />
|
||||
</div>,
|
||||
[hasMore, onLoadMoreComments, isLoadingMore]
|
||||
);
|
||||
|
||||
if (!node?.id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue