Skip to content

Commit

Permalink
Update hd compact story
Browse files Browse the repository at this point in the history
  • Loading branch information
origami-z committed May 22, 2024
1 parent 95c3e68 commit f260109
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/ag-grid-theme/stories/examples/HDCompact.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { UNSTABLE_SaltProviderNext } from "@salt-ds/core";
import {
SaltProvider,
UNSTABLE_SaltProviderNext,
useTheme,
} from "@salt-ds/core";
import { AgGridReact, AgGridReactProps } from "ag-grid-react";
import { useAgGridThemeSwitcher } from "../dependencies/ThemeSwitcher";
import dataGridExampleColumns from "../dependencies/dataGridExampleColumns";
Expand All @@ -18,15 +22,18 @@ const statusBar = {
};

const HDCompact = (props: AgGridReactProps) => {
const { themeNext } = useTheme();
const { themeName } = useAgGridThemeSwitcher();
const { agGridProps, containerProps } = useAgGridHelpers({
agThemeName: `ag-theme-${themeName}`,
compact: true,
density: "high",
});

const Provider = themeNext ? UNSTABLE_SaltProviderNext : SaltProvider;

return (
<UNSTABLE_SaltProviderNext density="high">
<Provider density="high">
<div {...containerProps}>
<AgGridReact
columnDefs={dataGridExampleColumns}
Expand All @@ -47,7 +54,7 @@ const HDCompact = (props: AgGridReactProps) => {
}}
/>
</div>
</UNSTABLE_SaltProviderNext>
</Provider>
);
};

Expand Down

0 comments on commit f260109

Please sign in to comment.