chore: Add ./components/[name]/index.ts map to package.json (#17319)
* chore: Add ./components/[name]/index.ts map to package.json * fix: Clarify Popover exports * fix: re-add dropdown to calcom/ui barrel * chore: Add icon barrel file re-export * Fix all calcom/ui imports of its own barrel * Never say 'fix all remaining..' it's never true * Some type fixeS * Linking fixes * Rename sheet.tsx to Sheet.tsx Done through UI, console does NOT like this. * Fixed some test failures
This commit is contained in:
1 parent
5c86522e28
commit
b9128a7a0b
79 files changed
+216
-195
No files matched your search
@@ -30,6 +30,7 @@ import {
|
||||
DataTableSelectionBar,
|
||||
DataTablePagination,
|
||||
} from "@calcom/ui";
|
||||
import { useFetchMoreOnBottomReached } from "@calcom/ui/data-table";
|
||||
import { useGetUserAttributes } from "@calcom/web/components/settings/platform/hooks/useGetUserAttributes";
|
||||
|
||||
import { DeleteBulkUsers } from "./BulkActions/DeleteBulkUsers";
|
||||
@@ -44,7 +45,6 @@ import { ImpersonationMemberModal } from "./ImpersonationMemberModal";
|
||||
import { InviteMemberModal } from "./InviteMemberModal";
|
||||
import { TableActions } from "./UserTableActions";
|
||||
import type { UserTableState, UserTableAction, UserTableUser } from "./types";
|
||||
import { useFetchMoreOnBottomReached } from "./useFetchMoreOnBottomReached";
|
||||
|
||||
type CustomColumnMeta<TData, TValue> = ColumnMeta<TData, TValue> & {
|
||||
sticky?: boolean;
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
import { useCallback, useEffect } from "react";
|
||||
|
||||
export const useFetchMoreOnBottomReached = (
|
||||
tableContainerRef: React.RefObject<HTMLDivElement>,
|
||||
fetchNextPage: () => void,
|
||||
isFetching: boolean,
|
||||
totalFetched: number,
|
||||
totalDBRowCount: number
|
||||
) => {
|
||||
const fetchMoreOnBottomReached = useCallback(
|
||||
(containerRefElement?: HTMLDivElement | null) => {
|
||||
if (containerRefElement) {
|
||||
const { scrollHeight, scrollTop, clientHeight } = containerRefElement;
|
||||
if (scrollHeight - scrollTop - clientHeight < 300 && !isFetching && totalFetched < totalDBRowCount) {
|
||||
fetchNextPage();
|
||||
}
|
||||
}
|
||||
},
|
||||
[fetchNextPage, isFetching, totalFetched, totalDBRowCount]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
fetchMoreOnBottomReached(tableContainerRef.current);
|
||||
}, [fetchMoreOnBottomReached, tableContainerRef]);
|
||||
|
||||
return fetchMoreOnBottomReached;
|
||||
};
|
||||
Reference in new issue
Block a user