From 792448cdcdc831556815fdb6d94cc030ebec773e Mon Sep 17 00:00:00 2001 From: Hristo Nedelkov Date: Fri, 3 Nov 2023 17:01:26 +0200 Subject: [PATCH] Update LogsTerminal.tsx --- src/pages/LogsPage/LogsTerminal.tsx | 60 ++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/src/pages/LogsPage/LogsTerminal.tsx b/src/pages/LogsPage/LogsTerminal.tsx index 59e52ee2..43a106bb 100644 --- a/src/pages/LogsPage/LogsTerminal.tsx +++ b/src/pages/LogsPage/LogsTerminal.tsx @@ -1,30 +1,52 @@ -import { LazyLog } from 'react-lazylog'; + +import { FixedSizeList as List } from 'react-window'; +import InfiniteLoader from 'react-window-infinite-loader'; +import { Button } from "tamagui"; + +// This is just a sample row renderer. Adjust according to your data. +function Row(props: any) { + const { index, style } = props; + return ( +
+ +
+ ); +} function LogsTerminal() { - const lineStyle = { - borderBottom: '1px solid #e0e0e0', - fontFamily: 'Courier New, monospace', - lineHeight: '1.5', - fontSize: '14px', + // Sample itemCount & loadMoreItems for demonstration purposes. + const itemCount = 1000; + const loadMoreItems = (startIndex: number, stopIndex: number) => { + console.log("Loading more items from:", startIndex, "to", stopIndex); + return new Promise((resolve) => setTimeout(resolve, 1000)); }; - const oddLineStyle = { - ...lineStyle, - backgroundColor: '#f7f7f7', - }; - - const lineContentStyle = { - color: '#333', + const isItemLoaded = (index: number) => { + // Add your logic here to check if the item is already loaded or not. + return false; }; return ( -
- lineNumber % 2 === 0 ? lineStyle : oddLineStyle} - textStyle={lineContentStyle} - /> +
+ + {({ onItemsRendered, ref }) => ( + + {Row} + + )} +
); }