upddate
This commit is contained in:
@@ -94,6 +94,19 @@ const MainNet = () => {
|
||||
}, [lastRefreshedTime]);
|
||||
|
||||
|
||||
const updateRelativeTime = () => {
|
||||
const now = new Date();
|
||||
const timeDiff = Math.floor((now - lastRefreshedTime) / 60000); // Difference in minutes
|
||||
|
||||
if (timeDiff < 1) {
|
||||
setRelativeRefreshTime("Just now");
|
||||
} else if (timeDiff === 1) {
|
||||
setRelativeRefreshTime("1 minute ago");
|
||||
} else {
|
||||
setRelativeRefreshTime(`${timeDiff} minutes ago`);
|
||||
}
|
||||
};
|
||||
|
||||
const handleRefreshClick = () => {
|
||||
setIsRotating(true); // Start rotation
|
||||
mainNetRefetch();
|
||||
|
||||
20
src/pages/SplashScreen.jsx
Normal file
20
src/pages/SplashScreen.jsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import React from "react";
|
||||
import { OPACITY_ON_LOAD } from "../Layout/animations";
|
||||
import { Box, Image, useColorMode } from "@chakra-ui/react";
|
||||
import logo from "../assets/images/rubix.png";
|
||||
import logoLight from "../assets/images/rubixlogo.svg";
|
||||
|
||||
const SplashScreen = () => {
|
||||
const { colorMode } = useColorMode();
|
||||
|
||||
return <Box zIndex={1000} bg={'#000'} h={'100vh'} display={'flex'} justifyContent={'center'} alignItems={'center'} {...OPACITY_ON_LOAD}>
|
||||
|
||||
<Image
|
||||
src={colorMode === "light" ? logoLight : logo}
|
||||
// width={"120px"}
|
||||
width={{base:"95px",md : "120px"}}
|
||||
/>
|
||||
</Box>;
|
||||
};
|
||||
|
||||
export default SplashScreen;
|
||||
@@ -61,8 +61,8 @@ const SubnetId = () => {
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
setTotalItems(subNetCount?.data?.transactionCount);
|
||||
}, [subNetCount]);
|
||||
setTotalItems(data?.data?.totalCount);
|
||||
}, [data]);
|
||||
|
||||
|
||||
// ===============================[ Table Header ]
|
||||
@@ -101,6 +101,7 @@ const SubnetId = () => {
|
||||
display={{ base: "block", md: "flex" }}
|
||||
justifyContent={"space-between"}
|
||||
mb={10}
|
||||
|
||||
>
|
||||
<Heading
|
||||
fontSize={"md"}
|
||||
|
||||
@@ -10,6 +10,7 @@ import { useGetSubnetByIdQuery } from "../Services/api.service";
|
||||
import rbtLogoOutline from "../assets/images/rubix-filled.svg";
|
||||
import { HiOutlineRefresh } from "react-icons/hi";
|
||||
import { rotate } from "../components/LatestTransactions/LatestTransactions";
|
||||
import Search from '../assets/images/search.png'
|
||||
|
||||
const SubnetInner = () => {
|
||||
|
||||
@@ -89,6 +90,20 @@ const SubnetInner = () => {
|
||||
}, [lastRefreshedTime]);
|
||||
|
||||
|
||||
const updateRelativeTime = () => {
|
||||
const now = new Date();
|
||||
const timeDiff = Math.floor((now - lastRefreshedTime) / 60000); // Difference in minutes
|
||||
|
||||
if (timeDiff < 1) {
|
||||
setRelativeRefreshTime("Just now");
|
||||
} else if (timeDiff === 1) {
|
||||
setRelativeRefreshTime("1 minute ago");
|
||||
} else {
|
||||
setRelativeRefreshTime(`${timeDiff} minutes ago`);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<Box p={"6rem 0 4rem 0"} backgroundImage={colorMode !== "light" ? `url(${bannerImage})` : "none"} position={"relative"} backgroundSize="contain" backgroundRepeat="no-repeat">
|
||||
@@ -112,7 +127,10 @@ const SubnetInner = () => {
|
||||
</Text> */}
|
||||
</Container>
|
||||
<Box>
|
||||
<Container maxW="6xl">
|
||||
{data?.data?.items?.length===0 || isLoading?<HStack h={'35vh'} justifyContent={"center"} mt={10}>
|
||||
<Image w={"40px"} src={Search}/>
|
||||
<Text as={"span"} color={"#787878"}>{"No records found"}</Text>
|
||||
</HStack>:<Container maxW="6xl">
|
||||
<Grid position={'relative'}
|
||||
templateColumns={{ base: "100% 0%", md: "10% 90%" }}
|
||||
gap={0}
|
||||
@@ -442,7 +460,7 @@ const SubnetInner = () => {
|
||||
setCurrentPage={setCurrentPage}
|
||||
currentPage={currentPage}
|
||||
/>
|
||||
</Container>
|
||||
</Container>}
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user