mirror of
https://github.com/WDI-Ideas/rubix.git
synced 2026-04-28 00:35:51 +00:00
Updated Api for Stats on Home page
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 (
|
||||
// <>
|
||||
// <Spinner color="#DE858E" />
|
||||
// </>
|
||||
// );
|
||||
// }
|
||||
// if (statIsLoading) {
|
||||
// return (
|
||||
// <>
|
||||
// <Spinner color="#DE858E" />
|
||||
// </>
|
||||
// );
|
||||
// }
|
||||
|
||||
return (
|
||||
<Box
|
||||
height={"auto"}
|
||||
@@ -108,7 +122,7 @@ const Stats = () => {
|
||||
{inView && (
|
||||
<CountUp
|
||||
start={50000000}
|
||||
end={51400000}
|
||||
end={statsData?.totalcoins}
|
||||
delay={0}
|
||||
style={{
|
||||
fontSize: `${isSmallScreen ? "23px" : "38px"}`,
|
||||
@@ -155,7 +169,7 @@ const Stats = () => {
|
||||
{inView && (
|
||||
<CountUp
|
||||
start={10000000}
|
||||
end={10247786}
|
||||
end={statData?.tokensCount}
|
||||
delay={0}
|
||||
style={{
|
||||
fontSize: `${isSmallScreen ? "23px" : "38px"}`,
|
||||
@@ -181,7 +195,7 @@ const Stats = () => {
|
||||
{inView && (
|
||||
<CountUp
|
||||
start={100000}
|
||||
end={201413}
|
||||
end={statData?.rubixUsersCount}
|
||||
delay={0}
|
||||
style={{
|
||||
fontSize: `${isSmallScreen ? "23px" : "38px"}`,
|
||||
@@ -248,7 +262,7 @@ const Stats = () => {
|
||||
{inView && (
|
||||
<CountUp
|
||||
start={50000000}
|
||||
end={10247786}
|
||||
end={statData?.curculatingSupplyCount}
|
||||
delay={0}
|
||||
style={{
|
||||
fontSize: `${isSmallScreen ? "23px" : "38px"}`,
|
||||
@@ -274,7 +288,7 @@ const Stats = () => {
|
||||
{inView && (
|
||||
<CountUp
|
||||
start={10000000}
|
||||
end={13572940}
|
||||
end={statData?.transactionsCount}
|
||||
delay={0}
|
||||
style={{
|
||||
fontSize: `${isSmallScreen ? "23px" : "38px"}`,
|
||||
|
||||
Reference in New Issue
Block a user