pl-fe: remove react-virtuoso

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-09-19 20:36:17 +02:00
parent 4965cee37b
commit 5650a65846
3 changed files with 0 additions and 59 deletions

View file

@ -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",

View file

@ -36,26 +36,6 @@ const timeChange = (prev: Pick<ChatMessageEntity, 'created_at'>, curr: Pick<Chat
const START_INDEX = 10000;
// const List: Components['List'] = React.forwardRef((props, ref) => {
// const { context, ...rest } = props;
// return <div ref={ref} {...rest} className='mb-2' />;
// });
// const Scroller: Components['Scroller'] = React.forwardRef((props, ref) => {
// const { style, context, ...rest } = props;
// return (
// <div
// {...rest}
// ref={ref}
// style={{
// ...style,
// scrollbarGutter: 'stable',
// }}
// />
// );
// });
interface IChatMessageList {
/** Chat the messages are being rendered from. */
chat: Chat;
@ -137,17 +117,6 @@ const ChatMessageList: React.FC<IChatMessageList> = ({ 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<IChatMessageList> = ({ chat }) => {
}
})}
</ScrollableList>
{/* <Virtuoso
alignToBottom
followOutput='auto'
itemContent={(index, chatMessage) => {
if (chatMessage.type === 'divider') {
return renderDivider(index, (chatMessage as any).text);
} else {
return <ChatMessage chat={chat} chatMessage={chatMessage} />;
}
}}
components={{
List,
Scroller,
Header: () => {
if (hasNextPage || isFetchingNextPage) {
return <Spinner withText={false} />;
}
return null;
},
}}
/> */}
</div>
</div>
);

View file

@ -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"