Skip to content

Scheduling infrastructure for absolutely everyone.

fix: missing responsive design in org members page (#17495)

Benny Joo1c20a257d3a1
diff --git a/packages/features/users/components/UserTable/UserListTable.tsx b/packages/features/users/components/UserTable/UserListTable.tsx
index 75e9584e3f4..52dff981455 100644
--- a/packages/features/users/components/UserTable/UserListTable.tsx
+++ b/packages/features/users/components/UserTable/UserListTable.tsx
@@ -475,38 +475,46 @@ export function UserListTable() {
isPending={isPending}
onScroll={(e) => fetchMoreOnBottomReached(e.target as HTMLDivElement)}>
<DataTableToolbar.Root className="lg:max-w-screen-2xl">
- <div className="flex w-full gap-2">
- <DataTableToolbar.SearchBar table={table} onSearch={(value) => setDebouncedSearchTerm(value)} />
- <DataTableToolbar.CTA
- type="button"
- color="secondary"
- StartIcon="file-down"
- loading={isDownloading}
- onClick={() => handleDownload()}
- data-testid="export-members-button">
- {t("download")}
- </DataTableToolbar.CTA>
- {/* We have to omit member because we don't want the filter to show but we can't disable filtering as we need that for the search bar */}
- <DataTableFilters.FilterButton table={table} omit={["member"]} />
- <DataTableFilters.ColumnVisibilityButton table={table} />
- {adminOrOwner && (
+ <div className="flex w-full flex-col gap-2 sm:flex-row">
+ <div className="w-full sm:w-auto sm:min-w-[200px] sm:flex-1">
+ <DataTableToolbar.SearchBar
+ table={table}
+ onSearch={(value) => setDebouncedSearchTerm(value)}
+ className="sm:max-w-64 max-w-full"
+ />
+ </div>
+ <div className="flex flex-wrap items-center gap-2">
<DataTableToolbar.CTA
type="button"
- color="primary"
- StartIcon="plus"
- className="rounded-md"
- onClick={() =>
- dispatch({
- type: "INVITE_MEMBER",
- payload: {
- showModal: true,
- },
- })
- }
- data-testid="new-organization-member-button">
- {t("add")}
+ color="secondary"
+ StartIcon="file-down"
+ loading={isDownloading}
+ onClick={() => handleDownload()}
+ data-testid="export-members-button">
+ {t("download")}
</DataTableToolbar.CTA>
- )}
+ {/* We have to omit member because we don't want the filter to show but we can't disable filtering as we need that for the search bar */}
+ <DataTableFilters.FilterButton table={table} omit={["member"]} />
+ <DataTableFilters.ColumnVisibilityButton table={table} />
+ {adminOrOwner && (
+ <DataTableToolbar.CTA
+ type="button"
+ color="primary"
+ StartIcon="plus"
+ className="rounded-md"
+ onClick={() =>
+ dispatch({
+ type: "INVITE_MEMBER",
+ payload: {
+ showModal: true,
+ },
+ })
+ }
+ data-testid="new-organization-member-button">
+ {t("add")}
+ </DataTableToolbar.CTA>
+ )}
+ </div>
</div>
<div className="flex gap-2 justify-self-start">
<DataTableFilters.ActiveFilters table={table} />
diff --git a/packages/ui/components/data-table/DataTableToolbar.tsx b/packages/ui/components/data-table/DataTableToolbar.tsx
index 9e30abd3ae7..e83ab97f9fb 100644
--- a/packages/ui/components/data-table/DataTableToolbar.tsx
+++ b/packages/ui/components/data-table/DataTableToolbar.tsx
@@ -34,10 +34,11 @@ interface SearchBarProps<TData> {
table: Table<TData>;
searchKey?: string;
onSearch?: (value: string) => void;
+ className?: string;
}
function SearchBarComponent<TData>(
- { table, searchKey, onSearch }: SearchBarProps<TData>,
+ { table, searchKey, onSearch, className }: SearchBarProps<TData>,
ref: React.Ref<HTMLInputElement>
) {
const [searchTerm, setSearchTerm] = useState("");
@@ -51,7 +52,7 @@ function SearchBarComponent<TData>(
return (
<Input
ref={ref}
- className="max-w-64 mb-0 mr-auto rounded-md"
+ className={`max-w-64 mb-0 mr-auto rounded-md ${className ?? ""}`}
placeholder="Search"
value={searchTerm}
onChange={(event) => setSearchTerm(event.target.value.trim())}