1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

fixed 'show more' status while initial comment load

This commit is contained in:
Fedor Katurov 2022-12-15 11:18:45 +06:00
parent 585f9b57cb
commit 60fdced237
2 changed files with 20 additions and 9 deletions

View file

@ -34,15 +34,21 @@ const NodeComments: FC<IProps> = memo(({ order }) => {
const groupped: ICommentGroup[] = useGrouppedComments(
comments,
order,
lastSeenCurrent ?? undefined
lastSeenCurrent ?? undefined,
);
const more = useMemo(
() =>
hasMore && <div className={styles.more}>
<LoadMoreButton isLoading={isLoadingMore} onClick={onLoadMoreComments} />
</div>,
[hasMore, onLoadMoreComments, isLoadingMore]
hasMore &&
!isLoading && (
<div className={styles.more}>
<LoadMoreButton
isLoading={isLoadingMore}
onClick={onLoadMoreComments}
/>
</div>
),
[hasMore, onLoadMoreComments, isLoadingMore, isLoading],
);
if (!node?.id) {
@ -53,7 +59,7 @@ const NodeComments: FC<IProps> = memo(({ order }) => {
<div className={styles.wrap}>
{order === 'DESC' && more}
{groupped.map(group => (
{groupped.map((group) => (
<Comment
nodeId={node.id!}
key={group.ids.join()}