From 5650a6584651f0d306fc28b9779c85fc5c774808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 19 Sep 2024 20:36:17 +0200 Subject: [PATCH] pl-fe: remove react-virtuoso MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- packages/pl-fe/package.json | 1 - .../chats/components/chat-message-list.tsx | 53 ------------------- packages/pl-fe/yarn.lock | 5 -- 3 files changed, 59 deletions(-) diff --git a/packages/pl-fe/package.json b/packages/pl-fe/package.json index b98e1a23c3..a95f350fec 100644 --- a/packages/pl-fe/package.json +++ b/packages/pl-fe/package.json @@ -162,7 +162,6 @@ "react-sparklines": "^1.7.0", "react-sticky-box": "^2.0.0", "react-swipeable-views": "^0.14.0", - "react-virtuoso": "^4.10.4", "redux": "^5.0.0", "redux-immutable": "^4.0.0", "redux-thunk": "^3.1.0", diff --git a/packages/pl-fe/src/features/chats/components/chat-message-list.tsx b/packages/pl-fe/src/features/chats/components/chat-message-list.tsx index 6a258ed866..d47f940d6f 100644 --- a/packages/pl-fe/src/features/chats/components/chat-message-list.tsx +++ b/packages/pl-fe/src/features/chats/components/chat-message-list.tsx @@ -36,26 +36,6 @@ const timeChange = (prev: Pick, curr: Pick { -// const { context, ...rest } = props; -// return
; -// }); - -// const Scroller: Components['Scroller'] = React.forwardRef((props, ref) => { -// const { style, context, ...rest } = props; - -// return ( -//
-// ); -// }); - interface IChatMessageList { /** Chat the messages are being rendered from. */ chat: Chat; @@ -137,17 +117,6 @@ const ChatMessageList: React.FC = ({ chat }) => { }; const cachedChatMessages = buildCachedMessages(); - // const initialScrollPositionProps = useMemo(() => { - // if (process.env.NODE_ENV === 'test') { - // return {}; - // } - - // return { - // initialTopMostItemIndex: cachedChatMessages.length - 1, - // firstItemIndex: Math.max(0, firstItemIndex), - // }; - // }, [cachedChatMessages.length, firstItemIndex]); - const handleStartReached = useCallback(() => { if (hasNextPage && !isFetching) { fetchNextPage(); @@ -253,28 +222,6 @@ const ChatMessageList: React.FC = ({ chat }) => { } })} - {/* { - if (chatMessage.type === 'divider') { - return renderDivider(index, (chatMessage as any).text); - } else { - return ; - } - }} - components={{ - List, - Scroller, - Header: () => { - if (hasNextPage || isFetchingNextPage) { - return ; - } - - return null; - }, - }} - /> */}
); diff --git a/packages/pl-fe/yarn.lock b/packages/pl-fe/yarn.lock index 0037711fd2..08fcf2e325 100644 --- a/packages/pl-fe/yarn.lock +++ b/packages/pl-fe/yarn.lock @@ -9071,11 +9071,6 @@ react-transition-group@^2.2.1: prop-types "^15.6.2" react-lifecycles-compat "^3.0.4" -react-virtuoso@^4.10.4: - version "4.10.4" - resolved "https://registry.yarnpkg.com/react-virtuoso/-/react-virtuoso-4.10.4.tgz#856ed415d7071db0c666ce84809bab8bb834f45c" - integrity sha512-G/gprhTbK+lzMxoo/iStcZxVEGph/cIhc3WANEpt92RuMw+LiCZOmBfKoeoZOHlm/iyftTrDJhGaTCpxyucnkQ== - react@^18.0.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"