Skip to content

Commit

Permalink
feat: allow override theme prop (#265)
Browse files Browse the repository at this point in the history
This will enable consumer of this lib to test out different ag-grid themes ( more than 1 ).

add comment
  • Loading branch information
kaga authored Mar 21, 2023
1 parent def4f8e commit 8e6c3bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface GridBaseRow {
export interface GridProps {
readOnly?: boolean; // set all editables to false when read only, make all styles black, otherwise style is gray for not editable
selectable?: boolean;
theme?: string; // should have prefix ag-theme-
["data-testid"]?: string;
domLayout?: GridOptions["domLayout"];
externalSelectedItems?: any[];
Expand Down Expand Up @@ -48,6 +49,7 @@ export const Grid = ({
"data-testid": dataTestId,
rowSelection = "multiple",
suppressColumnVirtualization = true,
theme = "ag-theme-alpine",
...params
}: GridProps): JSX.Element => {
const {
Expand Down Expand Up @@ -306,7 +308,7 @@ export const Grid = ({
data-testid={dataTestId}
className={clsx(
"Grid-container",
"ag-theme-alpine",
theme,
staleGrid && "Grid-sortIsStale",
gridReady && params.rowData && "Grid-ready",
)}
Expand Down

0 comments on commit 8e6c3bf

Please sign in to comment.