updatd oading

This commit is contained in:
2024-11-05 20:06:37 +05:30
parent 598e2ebd3b
commit e7a05cc9ed
2 changed files with 25 additions and 5 deletions

View File

@@ -5,19 +5,39 @@ import Footer from "../components/Footer/Footer";
import { Box, ScaleFade, SlideFade } from "@chakra-ui/react";
import { useLocation } from "react-router-dom";
import { useEffect } from "react";
import { useGetDailyDataQuery, useGetDateWiseDataQuery, useGetKPIDetailsQuery, useGetTransAllQuery } from "../Services/api.service";
import { timeZone } from "../Constants/Constants";
import SplashScreen from "../pages/SplashScreen";
const DefaultLayout = ({ children }) => {
const location = useLocation();
useEffect(() => {
localStorage.setItem("light", true)
});
// console.log(localStorage?.getItem("light"));
const {
isLoading,
} = useGetKPIDetailsQuery()
const {
isLoading: dateDataLoading,
} = useGetDateWiseDataQuery(timeZone === "Asia/Calcutta" ? "Asia/Kolkata" : timeZone);
const {
isLoading: dailyDataLoading,
} = useGetDailyDataQuery(timeZone === "Asia/Calcutta" ? "Asia/Kolkata" : timeZone);
// Fetch transactions based on the current page and page size
const {
isLoading: isTransAllLoading,
} = useGetTransAllQuery({
pageNumber: 1,
pageSize: 10,
});
return (
<Box>
isLoading || dateDataLoading || dailyDataLoading || isTransAllLoading ?<SplashScreen/>: <Box>
<NavBar />
<SlideFade
key={location.pathname}
@@ -34,7 +54,7 @@ const DefaultLayout = ({ children }) => {
{children}
</SlideFade>
<Footer />
</Box>
</Box>
);
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 819 KiB