diff --git a/packages/atlas/src/views/viewer/VideoView/CommentsSection.tsx b/packages/atlas/src/views/viewer/VideoView/CommentsSection.tsx index 6cd6df3944..0235346114 100644 --- a/packages/atlas/src/views/viewer/VideoView/CommentsSection.tsx +++ b/packages/atlas/src/views/viewer/VideoView/CommentsSection.tsx @@ -1,6 +1,7 @@ import { NetworkStatus } from '@apollo/client' import { FC, ReactElement, useEffect, useMemo, useRef, useState } from 'react' import { useParams } from 'react-router-dom' +import { CSSTransition, TransitionGroup } from 'react-transition-group' import { useComment, useUserCommentsReactions } from '@/api/hooks/comments' import { useCommentSectionComments } from '@/api/hooks/useCommentSectionComments' @@ -211,7 +212,7 @@ export const CommentsSection: FC = ({ disabled, video, vid }, }, children: ( - <> + {displayedCommentFromUrl && ( = ({ disabled, video, vid ? mappedPlaceholders : filteredComments ?.map((comment) => ( - 0} - repliesCount={comment.repliesCount} - userReactionsLookup={userReactions} - highlightedCommentId={highlightedCommentId} - setHighlightedCommentId={setHighlightedCommentId} - /> + + 0} + repliesCount={comment.repliesCount} + userReactionsLookup={userReactions} + highlightedCommentId={highlightedCommentId} + setHighlightedCommentId={setHighlightedCommentId} + /> + )) .concat(isFetchingMore && commentsLoading ? mappedPlaceholders : [])} - + ) as unknown as ReactElement[], }} footerProps={ diff --git a/packages/atlas/src/views/viewer/VideoView/VideoView.styles.ts b/packages/atlas/src/views/viewer/VideoView/VideoView.styles.ts index ebd3950d73..ce347e750a 100644 --- a/packages/atlas/src/views/viewer/VideoView/VideoView.styles.ts +++ b/packages/atlas/src/views/viewer/VideoView/VideoView.styles.ts @@ -218,6 +218,34 @@ export const CommentsStyledSection = styled(Section)` ${media.md} { margin-bottom: 0; } + + .comments-list { + display: flex; + flex-direction: column; + gap: 32px; + } + + .comment-enter { + opacity: 0; + transform: translateX(20px); + } + + .comment-enter-active { + opacity: 1; + transform: translateX(0); + transition: opacity 500ms, transform 500ms; + } + + .comment-exit { + opacity: 1; + transform: translateX(0); + } + + .comment-exit-active { + opacity: 0; + transform: translateX(-20px); + transition: opacity 500ms, transform 500ms; + } ` export const LoadMoreCommentsWrapper = styled.div`