diff --git a/src/Redux/store/store.js b/src/Redux/store/store.js index 7528242..d4a83a3 100644 --- a/src/Redux/store/store.js +++ b/src/Redux/store/store.js @@ -48,6 +48,10 @@ const store = configureStore({ ecoSystem.middleware, statsApi.middleware, ), // Add blogApi.middleware here + [statsApi.reducerPath]: statsApi.reducer, +}, + middleware: (getDefaultMiddleware) => + getDefaultMiddleware().concat(api.middleware, statsApi.middleware), }); export default store; diff --git a/src/components/HomePage/Stats.jsx b/src/components/HomePage/Stats.jsx index 907dc87..167b62b 100644 --- a/src/components/HomePage/Stats.jsx +++ b/src/components/HomePage/Stats.jsx @@ -1,22 +1,36 @@ -import { Box, Container, Text } from "@chakra-ui/react"; +/* eslint-disable no-unused-vars */ +import { Box, Container, Spinner, Text } from "@chakra-ui/react"; import { useInView } from "react-intersection-observer"; import CountUp from "react-countup"; import banner from "../../assets/images/Statsbanner.png"; import { useMediaQuery } from "@chakra-ui/react"; -import { useGetStatsApiQuery } from "../../Redux/slice/statsSlice"; const StatsContent = { heading: `Key Statistics`, }; const Stats = () => { - const { data, isLoading, error } = useGetStatsApiQuery(); - console.log(data); const [isSmallScreen] = useMediaQuery("(max-width: 435px)"); const { ref, inView } = useInView({ threshold: 0.5, triggerOnce: true, }); + + // if (statsIsLoading) { + // return ( + // <> + // + // + // ); + // } + // if (statIsLoading) { + // return ( + // <> + // + // + // ); + // } + return ( { {inView && ( { {inView && ( { {inView && ( { {inView && ( { {inView && (