update
This commit is contained in:
@@ -82,7 +82,7 @@ define(['./workbox-b5f7729d'], (function (workbox) { 'use strict';
|
||||
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
||||
}, {
|
||||
"url": "index.html",
|
||||
"revision": "0.1vefs8ecrtg"
|
||||
"revision": "0.k4sl9nq3coo"
|
||||
}], {});
|
||||
workbox.cleanupOutdatedCaches();
|
||||
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
||||
|
||||
@@ -10,50 +10,37 @@ import { timeZone } from "../Constants/Constants";
|
||||
import SplashScreen from "../pages/SplashScreen";
|
||||
|
||||
const DefaultLayout = ({ children }) => {
|
||||
const location = useLocation();
|
||||
useEffect(() => {
|
||||
localStorage.setItem("light", true)
|
||||
});
|
||||
|
||||
// const {
|
||||
// isLoading,
|
||||
// } = useGetKPIDetailsQuery()
|
||||
|
||||
|
||||
const {
|
||||
isLoading: dateDataLoading,
|
||||
} = useGetDateWiseDataQuery(timeZone === "Asia/Calcutta" ? "Asia/Kolkata" : timeZone);
|
||||
|
||||
data,
|
||||
isLoading,
|
||||
} = useGetKPIDetailsQuery()
|
||||
const {
|
||||
isLoading: dailyDataLoading,
|
||||
} = useGetDailyDataQuery(timeZone === "Asia/Calcutta" ? "Asia/Kolkata" : timeZone);
|
||||
|
||||
// Fetch transactions based on the current page and page size
|
||||
const {
|
||||
isLoading: isTransAllLoading,
|
||||
refetch
|
||||
} = useGetTransAllQuery({
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
|
||||
// useEffect(() => {
|
||||
// refetch()
|
||||
// }, [])
|
||||
|
||||
|
||||
|
||||
return (
|
||||
dateDataLoading || dailyDataLoading || isTransAllLoading ?<SplashScreen/>: <Box>
|
||||
dailyDataLoading || isLoading ? <SplashScreen/>: <Box>
|
||||
|
||||
<NavBar />
|
||||
{/* <SlideFade
|
||||
key={location.pathname}
|
||||
initialScale={0.9}
|
||||
finalScale={1.2}
|
||||
in={true}
|
||||
transition={{
|
||||
enter: {
|
||||
duration: 0.5,
|
||||
delay: 0.1,
|
||||
},
|
||||
}}
|
||||
> */}
|
||||
{children}
|
||||
{/* </SlideFade> */}
|
||||
<Footer />
|
||||
</Box>
|
||||
);
|
||||
|
||||
@@ -54,7 +54,7 @@ function ChartsTabs({ selectedValue, setSelectedValue, days }) {
|
||||
|
||||
const { getRootProps, getRadioProps } = useRadioGroup({
|
||||
name: "framework",
|
||||
defaultValue: "12 Months", // Default tab is set to '24 Hrs'
|
||||
defaultValue: "24 Hrs", // Default tab is set to '24 Hrs'
|
||||
onChange: (value) => setSelectedValue(value),
|
||||
});
|
||||
|
||||
|
||||
@@ -28,17 +28,15 @@ ChartJS.register(
|
||||
|
||||
const LineChart = () => {
|
||||
const { colorMode } = useColorMode();
|
||||
const [selectedValue, setSelectedValue] = useState("12 Months");
|
||||
const [selectedValue, setSelectedValue] = useState("24 Hrs");
|
||||
const [labels, setLabels] = useState([]);
|
||||
const [dataset, setDataset] = useState([]);
|
||||
const [isMobile] = useMediaQuery("(max-width: 768px)");
|
||||
|
||||
const {
|
||||
data: monthlyData,
|
||||
isLoading: monthlyDataLoading,
|
||||
} = useGetMonthlyDataQuery(timeZone === "Asia/Calcutta" ? "Asia/Kolkata" : timeZone);// Check if the screen is desktop or mobile
|
||||
|
||||
const isDesktop = window.innerWidth >= 768;
|
||||
|
||||
// Monthly dataset
|
||||
const dataSetMonthly = monthlyData?.map((data) => data?.transactionCount);
|
||||
@@ -54,7 +52,6 @@ const LineChart = () => {
|
||||
|
||||
const {
|
||||
data: dailyData,
|
||||
isLoading: dailyDataLoading,
|
||||
} = useGetDailyDataQuery(timeZone === "Asia/Calcutta" ? "Asia/Kolkata" : timeZone);
|
||||
|
||||
const dataSetDaily = dailyData?.map((data) => data?.transactionCount);
|
||||
@@ -62,7 +59,6 @@ const LineChart = () => {
|
||||
|
||||
const {
|
||||
data: dateData,
|
||||
isLoading: dateDataLoading,
|
||||
} = useGetDateWiseDataQuery(timeZone === "Asia/Calcutta" ? "Asia/Kolkata" : timeZone);
|
||||
|
||||
const dataSetDate = dateData?.data?.map((data) => data?.transactionCount);
|
||||
@@ -99,13 +95,7 @@ const LineChart = () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
// Calculate maximum value with a 10% buffer and round it up to the nearest whole number
|
||||
// console.log(dataset);
|
||||
// const maxYValue = Math.round(Math.max(...dataset) * 1.1);
|
||||
|
||||
|
||||
// const maxYValue = Math?.ceil(Math?.max(...dataset) * 1.1);
|
||||
|
||||
const options = {
|
||||
responsive: true,
|
||||
plugins: {
|
||||
|
||||
@@ -52,38 +52,6 @@ const Home = () => {
|
||||
const toast = useToast()
|
||||
const[ genrateSortURL ] = useGnerateShortUrlMutation()
|
||||
|
||||
// const handleGenrateShortURL = async () => {
|
||||
// try {
|
||||
// // Ensure searchTerm is converted to a string before passing to the API
|
||||
// const res = await genrateSortURL(JSON.stringify(searchTerm));
|
||||
// console.log(res);
|
||||
// } catch (error) {
|
||||
// console.error("Error generating short URL:", error);
|
||||
// }
|
||||
// };
|
||||
|
||||
|
||||
// function copyToClipboard(text) {
|
||||
// if (!navigator.clipboard) {
|
||||
// console.error("Clipboard API is not available.");
|
||||
// return;
|
||||
// }
|
||||
|
||||
// navigator.clipboard
|
||||
// .writeText(text)
|
||||
// .then(() => {
|
||||
// toast({
|
||||
// render: () => (
|
||||
// <ToastBox status={"warn"} message={"Text copied to clipboard"} />
|
||||
// ),
|
||||
// });
|
||||
// setIsCopy(true)
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// console.error("Failed to copy text: ", err);
|
||||
// });
|
||||
// }
|
||||
|
||||
function copyToClipboard(text) {
|
||||
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||
navigator.clipboard
|
||||
@@ -167,20 +135,15 @@ const toast = useToast()
|
||||
<Container maxW="3xl" position={"relative"}>
|
||||
<Box w={'100%'} display={"flex"} alignItems={"center"} flexDirection={'column'} gap={6}>
|
||||
<InputGroup
|
||||
|
||||
width={"100%"}
|
||||
boxShadow={"sm"}
|
||||
size="sm"
|
||||
bg={colorMode === "light" ? "light.100" : "#393939"}
|
||||
// border={"none"}
|
||||
rounded={'lg'}
|
||||
>
|
||||
<Input
|
||||
roundedLeft={8}
|
||||
w={"76%"}
|
||||
// border={`1px solid ${
|
||||
// colorMode === "light" ? "#230A79" : "#393939"
|
||||
// }`}
|
||||
borderColor={colorMode === "light"? "#CED4DA" : "#565252"}
|
||||
h={"42px"}
|
||||
type="search"
|
||||
@@ -218,8 +181,6 @@ const toast = useToast()
|
||||
color={'#fff'}
|
||||
isLoading={isLoading}
|
||||
onClick={handleGenrateShortURL}
|
||||
// isDisabled={!searchTerm}
|
||||
|
||||
pointerEvents={!searchTerm?'none':"auto"}
|
||||
>
|
||||
Generate Short Url
|
||||
@@ -248,14 +209,12 @@ const toast = useToast()
|
||||
cursor:!searchTerm?'not-allowed':"pointer"
|
||||
}}
|
||||
>
|
||||
{/* <IoSearch fontSize={"20px"} /> */}
|
||||
<BiSearchAlt fontSize={"20px"} />
|
||||
</Box>
|
||||
|
||||
</InputGroup>
|
||||
|
||||
|
||||
{/* Slide-down animated HStack */}
|
||||
<AnimatePresence>
|
||||
{isLoading || linkVisible && (
|
||||
<AnimatedBox
|
||||
|
||||
Reference in New Issue
Block a user