diff --git a/src/Components/DataTable/DataTable.jsx b/src/Components/DataTable/DataTable.jsx index e402b87..f9608c8 100644 --- a/src/Components/DataTable/DataTable.jsx +++ b/src/Components/DataTable/DataTable.jsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useContext } from "react"; import { Table, TableContainer, @@ -13,8 +13,12 @@ import { } from "@chakra-ui/react"; import EmptySearchList from "../EmptySearchList"; import Pagination from "../Pagination"; +import GlobalStateContext from "../../Contexts/GlobalStateContext"; const DataTable = ({ data, isLoading, tableHeadRow, emptyMessage, totalPages }) => { + const { slideFromRight } = useContext(GlobalStateContext); + + const columnWidth = data && data[0] ? `${(100 / Object.keys(data[0]).length).toFixed(2)}%` : "auto"; return ( @@ -27,7 +31,7 @@ const DataTable = ({ data, isLoading, tableHeadRow, emptyMessage, totalPages }) {tableHeadRow.map((heading, index) => ( - + {isLoading ? : heading} {/* {heading} */} @@ -39,7 +43,7 @@ const DataTable = ({ data, isLoading, tableHeadRow, emptyMessage, totalPages }) ? Array?.from({ length: 10 }).map((_, index) => ( {tableHeadRow.map((_, i) => ( - ( {tableHeadRow.map((heading, i) => ( - { + const { toggleColorMode } = useColorMode() + + const bg = useColorModeValue('red.500', 'red.200') + const color = useColorModeValue('white', 'gray.800') + return ( {/* */} {title} diff --git a/src/Contexts/GlobalStateProvider.jsx b/src/Contexts/GlobalStateProvider.jsx index ba86dc0..c43c916 100644 --- a/src/Contexts/GlobalStateProvider.jsx +++ b/src/Contexts/GlobalStateProvider.jsx @@ -11,6 +11,7 @@ const GlobalStateProvider = ({ children }) => { const [isAuthenticate, setIsAuthenticate] = useState(false); const [memberIfo, setMemberInfo] = useState(); const [communityMembers, setCommityMembers] = useState(); + const [slideFromRight, setSlideFormRight] = useState(false); const [sponser, setSponser] = useState([ { @@ -265,6 +266,8 @@ const GlobalStateProvider = ({ children }) => { setCommityMembers, sponser, setSponser, + slideFromRight, + setSlideFormRight }} > {children} diff --git a/src/Layout/DefaultLayout.jsx b/src/Layout/DefaultLayout.jsx index 969e7ff..c730caf 100644 --- a/src/Layout/DefaultLayout.jsx +++ b/src/Layout/DefaultLayout.jsx @@ -71,8 +71,7 @@ const DashboardLayout = () => { const path = location.pathname; const [isDrawerOpen, setIsDrawerOpen] = useState(false); const [openDrawerClick, setOpenDrawerClick] = useState(true); - const { setIsAuthenticate } = useContext(GlobalStateContext); - const [slideFromRight, setSlideFormRight] = useState(false); + const { setIsAuthenticate,slideFromRight,setSlideFormRight } = useContext(GlobalStateContext); const openDrawerOnClick = () => { setOpenDrawerClick(!openDrawerClick); @@ -328,7 +327,7 @@ const DashboardLayout = () => { style={{ width: isDrawerOpen || openDrawerClick ? 232 : 74, transition: "width 0.3s ease-in-out", // Smooth transition for width change - overflow: "hidden", // Hide overflow to prevent content overflow during transition + // overflow: "hidden", backgroundColor: "#0041180A", position: "relative", // backgroundColor: "#002F0F", @@ -362,8 +361,8 @@ const DashboardLayout = () => { {nav.map(({ title, type, Icon, submenu, path }, index) => { @@ -529,9 +528,9 @@ const DashboardLayout = () => { width: 18, height: 26, position: "absolute", - right: 0, + right: -19, bottom: 28, - zIndex: 333, + zIndex: 99, }} > {isDrawerOpen || openDrawerClick ? ( @@ -580,7 +579,7 @@ const DashboardLayout = () => { style={{ width: isDrawerOpen || openDrawerClick ? 232 : 74, transition: "width 0.3s ease-in-out", // Smooth transition for width change - overflow: "hidden", // Hide overflow to prevent content overflow during transition + // overflow: "hidden", backgroundColor: "#0041180A", position: "relative", // backgroundColor: "#002F0F", @@ -789,13 +788,13 @@ const DashboardLayout = () => { width: 18, height: 26, position: "absolute", - left: 0, + left: -18, bottom: 28, - zIndex: 333, + zIndex: 99, }} > {isDrawerOpen || openDrawerClick ? ( - + ) : ( )} diff --git a/src/Pages/Master/Sponser/Sponsers.jsx b/src/Pages/Master/Sponser/Sponsers.jsx index cadd87f..472587e 100644 --- a/src/Pages/Master/Sponser/Sponsers.jsx +++ b/src/Pages/Master/Sponser/Sponsers.jsx @@ -28,7 +28,7 @@ import CustomAlertDialog from "../../../Components/CustomAlertDialog"; const formatDate = (date) => new Date(date).toLocaleDateString(); // Simple date formatter const Sponser = () => { - const { sponser, setSponser } = useContext(GlobalStateContext); + const { sponser, setSponser,slideFromRight } = useContext(GlobalStateContext); const [searchTerm, setSearchTerm] = useState(""); const [isLoading, setIsLoading] = useState(true); const [deleteAlert, setDeleteAlert] = useState(false); @@ -79,7 +79,7 @@ const Sponser = () => { const extractedArray = filteredData?.map((item) => ({ "Sponser name": ( - { ), Address: ( - + {item.sponserAddress}