Compare commits

...

2 Commits
main ... master

Author SHA1 Message Date
Sean Brydon afa5e5a9a6 Use default colour 2023-10-05 14:59:05 +01:00
Siddharth Movaliya f0b97f1d33 fix: #11213, #11215 2023-10-05 16:37:42 +05:30
3 changed files with 10 additions and 18 deletions

View File

@ -36,10 +36,10 @@ export function DataTableToolbar<TData>({
const isFiltered = table.getState().columnFilters.length > 0;
return (
<div className="flex items-center justify-end space-x-2">
<div className="bg-default sticky top-[3rem] z-10 flex items-center justify-end space-x-2 py-4 md:top-0">
{searchKey && (
<Input
className="max-w-64 mb-0 mr-auto"
className="max-w-64 mb-0 mr-auto rounded-md"
placeholder="Search"
value={(table.getColumn(searchKey)?.getFilterValue() as string) ?? ""}
onChange={(event) => table.getColumn(searchKey)?.setFilterValue(event.target.value)}

View File

@ -102,21 +102,9 @@ export function DataTable<TData, TValue>({
searchKey={searchKey}
tableCTA={tableCTA}
/>
<div
className="border-subtle rounded-md border"
ref={tableContainerRef}
onScroll={onScroll}
style={{
height: "calc(100vh - 30vh)",
overflow: "auto",
}}>
<div className="border-subtle border" ref={tableContainerRef} onScroll={onScroll}>
<Table>
<TableHeader
style={{
position: "sticky",
top: 0,
zIndex: 1,
}}>
<TableHeader>
{table.getHeaderGroups().map((headerGroup) => (
<TableRow key={headerGroup.id}>
{headerGroup.headers.map((header) => {

View File

@ -4,7 +4,7 @@ import { classNames } from "@calcom/lib";
const Table = React.forwardRef<HTMLTableElement, React.HTMLAttributes<HTMLTableElement>>(
({ className, ...props }, ref) => (
<div className="w-full overflow-auto">
<div className="w-full overflow-auto md:overflow-visible">
<table ref={ref} className={classNames("w-full caption-bottom text-sm", className)} {...props} />
</div>
)
@ -13,7 +13,11 @@ Table.displayName = "Table";
const TableHeader = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(
({ className, ...props }, ref) => (
<thead ref={ref} className={classNames("[&_tr]:bg-subtle [&_tr]:border-b", className)} {...props} />
<thead
ref={ref}
className={classNames("[&_tr]:bg-subtle md:sticky md:top-[4.25rem] md:z-10 [&_tr]:border-b", className)}
{...props}
/>
)
);
TableHeader.displayName = "TableHeader";