diff --git a/packages/features/users/components/UserTable/BulkActions/DeleteBulkUsers.tsx b/packages/features/users/components/UserTable/BulkActions/DeleteBulkUsers.tsx index 639618f4c6..3215264b71 100644 --- a/packages/features/users/components/UserTable/BulkActions/DeleteBulkUsers.tsx +++ b/packages/features/users/components/UserTable/BulkActions/DeleteBulkUsers.tsx @@ -8,9 +8,10 @@ import type { User } from "../UserListTable"; interface Props { users: User[]; + onRemove: () => void; } -export function DeleteBulkUsers({ users }: Props) { +export function DeleteBulkUsers({ users, onRemove }: Props) { const { t } = useLocale(); const selectedRows = users; // Get selected rows from table const utils = trpc.useContext(); @@ -37,6 +38,7 @@ export function DeleteBulkUsers({ users }: Props) { deleteMutation.mutateAsync({ userIds: selectedRows.map((user) => user.id), }); + onRemove(); }}>

{t("remove_users_from_org_confirm", { diff --git a/packages/features/users/components/UserTable/UserListTable.tsx b/packages/features/users/components/UserTable/UserListTable.tsx index a2b9ecb3d6..f929cc4998 100644 --- a/packages/features/users/components/UserTable/UserListTable.tsx +++ b/packages/features/users/components/UserTable/UserListTable.tsx @@ -290,7 +290,10 @@ export function UserListTable() { { type: "render", render: (table) => ( - row.original)} /> + row.original)} + onRemove={() => table.toggleAllPageRowsSelected(false)} + /> ), }, ]} diff --git a/packages/ui/components/data-table/DataTableSelectionBar.tsx b/packages/ui/components/data-table/DataTableSelectionBar.tsx index 26c7f6797d..04f738bc8d 100644 --- a/packages/ui/components/data-table/DataTableSelectionBar.tsx +++ b/packages/ui/components/data-table/DataTableSelectionBar.tsx @@ -1,4 +1,5 @@ import type { Table } from "@tanstack/react-table"; +import { motion, AnimatePresence } from "framer-motion"; import { Fragment } from "react"; import type { SVGComponent } from "@calcom/types/SVGComponent"; @@ -24,23 +25,30 @@ interface DataTableSelectionBarProps { export function DataTableSelectionBar({ table, actions }: DataTableSelectionBarProps) { const numberOfSelectedRows = table.getSelectedRowModel().rows.length; - - if (numberOfSelectedRows === 0) return null; + const isVisible = numberOfSelectedRows > 0; return ( -

-
{numberOfSelectedRows} selected
- {actions?.map((action, index) => ( - - {action.type === "action" ? ( - - ) : action.type === "render" ? ( - action.render(table) - ) : null} - - ))} -
+ + {isVisible ? ( + +
{numberOfSelectedRows} selected
+ {actions?.map((action, index) => ( + + {action.type === "action" ? ( + + ) : action.type === "render" ? ( + action.render(table) + ) : null} + + ))} +
+ ) : null} +
); } diff --git a/packages/ui/components/data-table/index.tsx b/packages/ui/components/data-table/index.tsx index 5a41ebcf4e..5bc08e04b6 100644 --- a/packages/ui/components/data-table/index.tsx +++ b/packages/ui/components/data-table/index.tsx @@ -95,7 +95,7 @@ export function DataTable({ virtualRows.length > 0 ? totalSize - (virtualRows?.[virtualRows.length - 1]?.end || 0) : 0; return ( -
+