diff --git a/index.html b/index.html
index e4b78ea..d3a2061 100644
--- a/index.html
+++ b/index.html
@@ -2,9 +2,9 @@
-
+
- Vite + React + TS
+ Pull the Trigger
diff --git a/package.json b/package.json
index 56d3cf1..d8b9b05 100644
--- a/package.json
+++ b/package.json
@@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
- "build": "tsc && vite build",
+ "build": "vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
diff --git a/public/gun.jpg b/public/gun.jpg
new file mode 100644
index 0000000..ac6a6cf
Binary files /dev/null and b/public/gun.jpg differ
diff --git a/src/App.tsx b/src/App.tsx
index 77356e7..f64097d 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -20,6 +20,8 @@ import ThemeProvider from "./components/ThemeProvider";
import "@mantine/core/styles.css"; //import Mantine V7 styles needed by MRT
import "@mantine/dates/styles.css"; //if using mantine date picker features
import "mantine-react-table/styles.css"; //import MRT styles
+import { appTheme } from "./contexts/theme";
+import { useAtom } from "jotai";
function App() {
const { data, isFetched } = useQueryAPI({
@@ -31,46 +33,50 @@ function App() {
defaultValue: "blackboard",
});
- const [currentTheme, setCurrentTheme] = useState(undefined);
+ const [theme, setTheme] = useAtom(appTheme);
useEffect(() => {
if (data && themeName) {
const temp = data.find((t: any) => t.name === themeName);
- setCurrentTheme(temp);
+ setTheme(temp);
}
}, [isFetched, themeName]);
const router = createBrowserRouter(
createRoutesFromElements(
- } />
+ } />
}
+ element={}
/>
,
),
);
const overrides = createTheme({
- white: currentTheme?.colorbackground,
+ white: theme?.colorbackground,
fontFamily:
"-apple-system,Jost,BlinkMacSystemFont,Helvetica Neue,Roboto,sans-serif",
});
const mantineTheme = mergeMantineTheme(DEFAULT_THEME, overrides);
-
+
return (
-
- {currentTheme && (
-
-
+ <>
+ {theme && (
+
+
+
+
)}
-
+ >
+
+
);
}
-export default App;
+export default App;
\ No newline at end of file
diff --git a/src/DataTable/DataTable.tsx b/src/DataTable/DataTable.tsx
index 1af49ea..3c2c345 100644
--- a/src/DataTable/DataTable.tsx
+++ b/src/DataTable/DataTable.tsx
@@ -6,11 +6,14 @@ import {
} from "mantine-react-table";
import { memo } from "react";
import "../dataTableStyles.css";
-import { ActionIcon, Button, Flex, Text, Tooltip } from "@mantine/core";
+import { ActionIcon, Button, Flex, Text } from "@mantine/core";
import { FiPlus } from "react-icons/fi";
import { IconEdit, IconTrash } from "@tabler/icons-react";
import { useMutationAPI } from "../hooks/useAPI";
import { modals } from "@mantine/modals";
+import { actionIconClasses, buttonClasses } from "../styles";
+import { appTheme } from "../contexts/theme";
+import { useAtom } from "jotai";
export function DataTableComponent({
tableName,
@@ -27,10 +30,10 @@ export function DataTableComponent({
isLoading: boolean;
endpoint: string;
}) {
- const { mutateAsync: createRow, isPending: isCreatingRow } = useMutationAPI();
- const { mutateAsync: editRow, isPending: isEditingRow } = useMutationAPI();
- const { mutateAsync: deleteRow, isPending: isDeletingRow } = useMutationAPI();
-
+ const [theme, setTheme] = useAtom(appTheme);
+ const { mutateAsync: createRow } = useMutationAPI();
+ const { mutateAsync: editRow } = useMutationAPI();
+ const { mutateAsync: deleteRow } = useMutationAPI();
const handleCreateRow: MRT_TableOptions["onCreatingRowSave"] = async ({
values,
exitCreatingMode,
@@ -45,7 +48,7 @@ export function DataTableComponent({
editRow({ method: "PATCH", endpoint: endpoint, body: values });
table.setEditingRow(null);
};
-
+console.log(theme)
const openDeleteConfirmModal = (row: MRT_Row) =>
modals.openConfirmModal({
title: "Are you sure you want to delete this user?",
@@ -55,7 +58,6 @@ export function DataTableComponent({
onConfirm: () =>
deleteRow({ method: "DELETE", endpoint: endpoint, body: row.original }),
});
-
const table = useMantineReactTable({
columns: columns,
data: tableData,
@@ -80,36 +82,25 @@ export function DataTableComponent({
showLoadingOverlay: isLoading,
isLoading: isLoading,
},
- mantineTableHeadProps: {
- style: {
- color: "var(--color-text-pri)",
- },
- },
- mantineTableBodyCellProps: {
- style: {
- color: "var(--color-text-pri)",
- background: "var(--color-background)",
- borderRight: "none",
- borderLeft: "none",
- },
- },
+ mantinePaperProps: {className: 'root'},
renderRowActions: ({ row, table }) => (
-
- table.setEditingRow(row)}>
-
-
-
-
- openDeleteConfirmModal(row)}>
-
-
-
+ table.setEditingRow(row)}>
+
+
+ openDeleteConfirmModal(row)}>
+
+
),
+ mantineCreateRowModalProps: {
+ style: {
+ color: theme.colortextpri,
+ },
+ },
renderTopToolbarCustomActions: ({ table }) => {
return (
-