From b2d4198df714c92dae0df9a6a91a662b65e20948 Mon Sep 17 00:00:00 2001 From: Sudhanshu Dasgupta Date: Fri, 13 Sep 2024 11:13:55 +0000 Subject: [PATCH] Fix theme and fix column visibility issue Signed-off-by: Sudhanshu Dasgupta --- .../Sistent/components/Table/index.js | 22 ++++++++++++++----- .../Sistent/components/Table/table-column.js | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/sections/Projects/Sistent/components/Table/index.js b/src/sections/Projects/Sistent/components/Table/index.js index c83b1ee7651f..26a9ce3fc679 100644 --- a/src/sections/Projects/Sistent/components/Table/index.js +++ b/src/sections/Projects/Sistent/components/Table/index.js @@ -4,11 +4,16 @@ import { SistentLayout } from "../../sistent-layout"; import TabButton from "../../../../../reusecore/Button"; import { navigate } from "gatsby"; import { useLocation } from "@reach/router"; -import { ResponsiveDataTable, SistentThemeProviderWithoutBaseLine } from "@layer5/sistent"; +import { ResponsiveDataTable, SistentThemeProvider } from "@layer5/sistent"; import { basicColumns, basicData, basicOptions, customColumns, customData, options } from "./table-column"; +import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode"; +import { useState } from "react"; export const DataTable = () => { const location = useLocation(); + const { isDark } = useStyledDarkMode(); + const [tableCols, updateCols] = useState(basicColumns); + const [customTableCols, updateCustomCols] = useState(customColumns); return (
@@ -63,25 +68,30 @@ export const DataTable = () => {

A simple example of a table with three columns: Name, Type, and Description.

- + - + -

With customized columns

+

Sorting and Columns Visibility

A table with customized columns. Here data can be sorted and filtered. + This example demonstrates the use of Checkbox and clickable rows for selection, with a custom Toolbar.

- + - +
diff --git a/src/sections/Projects/Sistent/components/Table/table-column.js b/src/sections/Projects/Sistent/components/Table/table-column.js index 74d141cfd4cc..bbedfc1aec96 100644 --- a/src/sections/Projects/Sistent/components/Table/table-column.js +++ b/src/sections/Projects/Sistent/components/Table/table-column.js @@ -8,7 +8,7 @@ export const basicData = [ ]; export const basicOptions = { - filterType: "checkbox", + selectableRows: "none", }; export const customColumns = [