Skip to content

Commit 58a655e

Browse files
committed
fix: user table to load on scroll
Signed-off-by: Chayan Das <daschayan8837@gmail.com>
1 parent 561cf88 commit 58a655e

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

apps/web/modules/users/components/UsersTable.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,22 @@ export function UsersTable() {
109109
}, [fetchMoreOnBottomReached]);
110110

111111
return (
112-
<div>
112+
<div className="flex flex-col gap-3">
113113
<TextField
114114
placeholder="username or email"
115115
label={t("search")}
116116
onChange={(e) => setSearchTerm(e.target.value)}
117117
/>
118+
<p className="text-subtle text-sm">
119+
{isFetching && totalFetched === 0
120+
? t("loading")
121+
: `${t("showing_x_of_y", { x: totalFetched, y: totalRowCount })}`}
122+
</p>
123+
118124
<div
119125
className="border-subtle rounded-md border"
120126
ref={tableContainerRef}
121-
onScroll={() => fetchMoreOnBottomReached()}
127+
onScroll={(e) => fetchMoreOnBottomReached(e.currentTarget)}
122128
style={{
123129
height: "calc(100vh - 30vh)",
124130
overflow: "auto",

0 commit comments

Comments
 (0)