Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/apollo-vertex/registry/data-table/data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ interface DataTableProps<TData, TValue> {
renderExpandedRow?: (row: Row<TData>) => React.ReactNode;
getRowClassName?: (row: TData) => string;
skeletonColumnWidths?: string[];
plain?: boolean;
}

function DataTable<TData, TValue>({
Expand Down Expand Up @@ -123,6 +124,7 @@ function DataTable<TData, TValue>({
renderExpandedRow,
getRowClassName,
skeletonColumnWidths,
plain = false,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does plain mean, can we give it a better name?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xr3ngar If the constant is named GLASS_CLASSES, we can make the option name clearer — for example, a boolean glass, a union variant: "glass" | "plain", glassClasses, or transparent.

The core issue is that we need a way to render the data table without GLASS_CLASSES. WDYT?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we want to render it without? This is the current design no?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When data tables are the main item in a page (eg our loans table view), glass class is appropriate. Sometimes we need a data table without the glass class when it's inside a another container in a page (and having the glass classes would be too much).
image

}: DataTableProps<TData, TValue>) {
const { t } = useTranslation();

Expand Down Expand Up @@ -207,7 +209,7 @@ function DataTable<TData, TValue>({
<div
ref={containerRef}
className={cn(
GLASS_CLASSES,
!plain && GLASS_CLASSES,
"relative min-w-0 overflow-hidden",
stickyHeader && "overflow-auto",
)}
Expand Down
Loading