From f5cd140a7d75051d7a57f75bc39bdbe7baa361cf Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Thu, 9 Nov 2023 16:59:10 +0000 Subject: [PATCH] delete unused utils --- client/src/features/comment/utils.ts | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 client/src/features/comment/utils.ts diff --git a/client/src/features/comment/utils.ts b/client/src/features/comment/utils.ts deleted file mode 100644 index b673023..0000000 --- a/client/src/features/comment/utils.ts +++ /dev/null @@ -1,19 +0,0 @@ -export function scrollToComment(commentId) { - const selector = `div[data-comment-id="${commentId}"]`; - const commentElement = document.querySelector(selector); - if (commentElement) { - commentElement.scrollIntoView({ behavior: 'smooth' }); - } -} - -export const scrollToCommentInScrollArea = (commentId, scrollAreaRef) => { - const commentElement = scrollAreaRef.current.querySelector(`[data-comment-id="${commentId}"]`); - - if (commentElement) { - const scrollArea = scrollAreaRef.current; - const commentTop = commentElement.offsetTop; - const scrollAreaTop = scrollArea.offsetTop; - - scrollArea.scrollTop = commentTop - scrollAreaTop; - } -};