update
This commit is contained in:
@@ -32,7 +32,8 @@
|
||||
}
|
||||
|
||||
.active {
|
||||
background-color: #ced8e6a2;
|
||||
background-color: #004717;
|
||||
color: #fff;
|
||||
/* background-color: #e2e8f01c; */
|
||||
}
|
||||
|
||||
@@ -43,12 +44,14 @@
|
||||
}
|
||||
|
||||
.link:hover {
|
||||
background-color: #ced8e6a2 !important;
|
||||
background-color: #ced8e6a2;
|
||||
/* color: #fff; */
|
||||
/* background-color: #e2e8f01c !important; */
|
||||
}
|
||||
|
||||
.active:hover {
|
||||
background-color: #ced8e6a2 !important;
|
||||
background-color: #004717;
|
||||
color: #fff;
|
||||
/* background-color: #e2e8f01c !important; */
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import * as XLSX from "xlsx";
|
||||
import profile from "../assets/proavatar.webp";
|
||||
import GlobalStateContext from "../Contexts/GlobalStateContext";
|
||||
import { MdOutlineDarkMode, MdOutlineLightMode } from "react-icons/md";
|
||||
import logoMini from "../assets/logo-min.png"
|
||||
import logoMini from "../assets/propic.png"
|
||||
|
||||
const HeaderMain = ({
|
||||
link,
|
||||
@@ -82,7 +82,7 @@ const HeaderMain = ({
|
||||
name="Tanami M"
|
||||
src={logoMini}
|
||||
bg={'green.100'}
|
||||
p={1}
|
||||
// p={1}
|
||||
/>
|
||||
<Box
|
||||
style={{
|
||||
|
||||
@@ -142,7 +142,7 @@ const ViewIOTable = () => {
|
||||
"IO Status": (
|
||||
<Box w={"auto"} isTruncated={true}>
|
||||
<Badge
|
||||
rounded={"md"}
|
||||
rounded={"sm"}
|
||||
pt={0.5}
|
||||
pb={0.5}
|
||||
ps={4}
|
||||
@@ -179,12 +179,13 @@ const ViewIOTable = () => {
|
||||
placement="top"
|
||||
>
|
||||
<Button
|
||||
_hover={{ color: "green.500" }}
|
||||
// _hover={{ color: "green.500" }}
|
||||
colorScheme="green"
|
||||
// transition={"0.5s all"}
|
||||
onClick={() => {
|
||||
navigate(`/view-io/${item.id}`);
|
||||
}}
|
||||
color="green.300"
|
||||
// color="green.300"
|
||||
rounded={"sm"}
|
||||
size={"xs"}
|
||||
>
|
||||
@@ -201,12 +202,13 @@ const ViewIOTable = () => {
|
||||
placement="top"
|
||||
>
|
||||
<Button
|
||||
_hover={{ color: "green.500" }}
|
||||
// _hover={{ color: "green.500" }}
|
||||
// transition={"0.5s all"}
|
||||
onClick={() => {
|
||||
navigate(`/create-io/${item.id}`);
|
||||
}}
|
||||
color="green.300"
|
||||
// color="green.300"
|
||||
colorScheme="blue"
|
||||
rounded={"sm"}
|
||||
size={"xs"}
|
||||
>
|
||||
|
||||
@@ -183,34 +183,41 @@ const InvestorDetails = () => {
|
||||
),
|
||||
"Investor Type": (
|
||||
<Box w={"auto"} isTruncated={true}>
|
||||
<Text as={"span"} color={"teal.900"}>
|
||||
<Badge fontWeight={"500"} px={2} py={0.5}>
|
||||
<Text as={"span"} color={"purple"}>
|
||||
<Badge colorScheme="purple" variant={'solid'} fontWeight={"500"} px={2} py={0.5}>
|
||||
{item?.investor_type?.investorTypeName}
|
||||
</Badge>
|
||||
</Text>
|
||||
</Box>
|
||||
),
|
||||
Status: (
|
||||
<Box w={"auto"} isTruncated={true}>
|
||||
<Badge
|
||||
fontWeight={"500"}
|
||||
// textTransform={"none"}
|
||||
colorScheme={item.ioStatus ? "red" : "green"}
|
||||
px={2}
|
||||
py={0.5}
|
||||
variant={'solid'}
|
||||
>
|
||||
{item.ioStatus ? "Ban" : "Unban"}
|
||||
</Badge>
|
||||
</Box>
|
||||
),
|
||||
"KYC Status": (
|
||||
<Box w={"auto"} isTruncated={true}>
|
||||
<Badge
|
||||
fontWeight={"500"}
|
||||
textTransform={"none"}
|
||||
// textTransform={"none"}
|
||||
colorScheme={item.kycStatus ? "blue" : "red"}
|
||||
px={2}
|
||||
py={0.5}
|
||||
variant={'solid'}
|
||||
>
|
||||
{item.KYCStatus ? "Completed" : "Not complete"}
|
||||
</Badge>
|
||||
</Box>
|
||||
),
|
||||
Status: (
|
||||
<Switch
|
||||
size={"sm"}
|
||||
colorScheme="forestGreen"
|
||||
onChange={() => handleUpdateStatus(item.id)}
|
||||
isChecked={item.userStatus}
|
||||
/>
|
||||
),
|
||||
Action: (
|
||||
<Box display={"flex"} justifyContent={"center"} gap={2}>
|
||||
<Tooltip
|
||||
@@ -225,9 +232,10 @@ const InvestorDetails = () => {
|
||||
onClick={() => {
|
||||
navigate(`/investor-details/profile-view/${item.id}`);
|
||||
}}
|
||||
_hover={{ color: "green.500" }}
|
||||
// _hover={{ color: "green.500" }}
|
||||
// transition={"0.5s all"}
|
||||
color="green.300"
|
||||
// color="green.300"
|
||||
colorScheme="green"
|
||||
rounded={"sm"}
|
||||
size={"xs"}
|
||||
>
|
||||
|
||||
@@ -24,7 +24,10 @@ import { BiMessageSquareEdit } from "react-icons/bi";
|
||||
import { TbEdit } from "react-icons/tb";
|
||||
import { EditIcon, ViewIcon } from "@chakra-ui/icons";
|
||||
import { formatDate } from "../../../Components/Functions/UTCConvertor";
|
||||
import { useGetExchangeRateByIdQuery, useUpdateExchangeRateMutation } from "../../../Services/exchange.rate.service";
|
||||
import {
|
||||
useGetExchangeRateByIdQuery,
|
||||
useUpdateExchangeRateMutation,
|
||||
} from "../../../Services/exchange.rate.service";
|
||||
import ToastBox from "../../../Components/ToastBox";
|
||||
|
||||
// Convert date to YYYY-MM-DD format
|
||||
@@ -41,18 +44,18 @@ const formatDateValue = (date) => {
|
||||
return [year, month, day].join("-");
|
||||
};
|
||||
|
||||
const EditExchangeRate = ({ id, setIsLoading, updateHistory }) => {
|
||||
const EditExchangeRate = ({ id, setIsLoading, updateHistory }) => {
|
||||
const btnRef = useRef();
|
||||
const toast = useToast();
|
||||
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||
const { rateExchange, setRateExchange } = useContext(GlobalStateContext);
|
||||
const [ isBtnLoading, setIsBtnLoading ] = useState(false)
|
||||
const [isBtnLoading, setIsBtnLoading] = useState(false);
|
||||
|
||||
const { data, isLoading, errors } = useGetExchangeRateByIdQuery(id, {
|
||||
skip: !id,
|
||||
});
|
||||
|
||||
const [ updateExchange ] = useUpdateExchangeRateMutation()
|
||||
const [updateExchange] = useUpdateExchangeRateMutation();
|
||||
const foundObject = data?.data;
|
||||
const [rate, setRate] = useState("");
|
||||
const [alert, setAlert] = useState(false);
|
||||
@@ -64,32 +67,23 @@ const EditExchangeRate = ({ id, setIsLoading, updateHistory }) => {
|
||||
}, [foundObject]);
|
||||
|
||||
const handleSave = async () => {
|
||||
setIsBtnLoading(true)
|
||||
setIsBtnLoading(true);
|
||||
try {
|
||||
|
||||
const data = {
|
||||
rate: rate
|
||||
}
|
||||
const res = await updateExchange({data, id})
|
||||
rate: rate,
|
||||
};
|
||||
const res = await updateExchange({ data, id });
|
||||
console.log(res?.data?.statusCode);
|
||||
if (res?.data?.statusCode === 200) {
|
||||
console.log("hit");
|
||||
toast({
|
||||
render: () => <ToastBox message={res?.data?.message} />,
|
||||
});
|
||||
setIsBtnLoading(false)
|
||||
setAlert(false)
|
||||
onClose()
|
||||
setIsBtnLoading(false);
|
||||
setAlert(false);
|
||||
onClose();
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (error) {}
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -106,9 +100,10 @@ const EditExchangeRate = ({ id, setIsLoading, updateHistory }) => {
|
||||
<Button
|
||||
ref={btnRef}
|
||||
onClick={onOpen}
|
||||
_hover={{ color: "blue.500" }}
|
||||
// _hover={{ color: "blue.500" }}
|
||||
// transition={"0.5s all"}
|
||||
color="blue.400"
|
||||
// color="blue.400"
|
||||
colorScheme="blue"
|
||||
size={"xs"}
|
||||
// size={{base:'xs', lg:'sm'}}
|
||||
rounded={"sm"}
|
||||
@@ -116,7 +111,7 @@ const EditExchangeRate = ({ id, setIsLoading, updateHistory }) => {
|
||||
alignItems={"center"}
|
||||
gap={1}
|
||||
>
|
||||
<EditIcon /> Update
|
||||
<EditIcon />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Drawer
|
||||
@@ -126,37 +121,42 @@ const EditExchangeRate = ({ id, setIsLoading, updateHistory }) => {
|
||||
onClose={onClose}
|
||||
finalFocusRef={btnRef}
|
||||
>
|
||||
<form onSubmit={(e) =>{
|
||||
e.preventDefault()
|
||||
setAlert(true)}}>
|
||||
<DrawerOverlay />
|
||||
<DrawerContent>
|
||||
<DrawerCloseButton />
|
||||
<DrawerHeader fontSize={"md"}>Edit rate</DrawerHeader>
|
||||
|
||||
<DrawerBody>
|
||||
|
||||
<Box display={"flex"} mb={5}>
|
||||
<Box w={"50%"} display={"flex"} flexDirection={"column"} gap={1}>
|
||||
<FormLabel fontSize={"sm"}>From</FormLabel>
|
||||
<Text as={"span"} fontSize={"sm"} fontWeight={"bold"}>
|
||||
|
||||
{foundObject?.fromCurrency?.currencyCode}
|
||||
{foundObject?.fromCurrency?.currencyCode}
|
||||
</Text>
|
||||
</Box>
|
||||
<Box w={"50%"} display={"flex"} flexDirection={"column"} gap={1}>
|
||||
<FormLabel fontSize={"sm"}>To</FormLabel>
|
||||
<Text as={"span"} fontSize={"sm"} fontWeight={"bold"}>
|
||||
|
||||
{foundObject?.toCurrency?.currencyCode}
|
||||
{foundObject?.toCurrency?.currencyCode}
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
<FormControl mb={4}>
|
||||
<FormLabel fontSize={"sm"}>Effective from</FormLabel>
|
||||
<Text fontSize={"sm"}>{formatDate(foundObject?.effectiveFrom)}</Text>
|
||||
<Text fontSize={"sm"}>
|
||||
{formatDate(foundObject?.effectiveFrom)}
|
||||
</Text>
|
||||
</FormControl>
|
||||
|
||||
<FormControl mb={4}>
|
||||
<FormControl mb={4} isRequired>
|
||||
<FormLabel fontSize={"sm"}>Rate</FormLabel>
|
||||
<Input
|
||||
required
|
||||
type="number"
|
||||
placeholder="Type rate here..."
|
||||
size={"sm"}
|
||||
@@ -169,7 +169,7 @@ const EditExchangeRate = ({ id, setIsLoading, updateHistory }) => {
|
||||
<DrawerFooter>
|
||||
<Button
|
||||
variant="outline"
|
||||
colorScheme={"green"}
|
||||
colorScheme={"forestGreen"}
|
||||
rounded={"sm"}
|
||||
size={"sm"}
|
||||
mr={3}
|
||||
@@ -179,15 +179,16 @@ const EditExchangeRate = ({ id, setIsLoading, updateHistory }) => {
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
colorScheme={"green"}
|
||||
colorScheme={"forestGreen"}
|
||||
rounded={"sm"}
|
||||
size={"sm"}
|
||||
onClick={() => setAlert(true)}
|
||||
type="submit"
|
||||
>
|
||||
Save
|
||||
</Button>
|
||||
</DrawerFooter>
|
||||
</DrawerContent>
|
||||
</form>
|
||||
</Drawer>
|
||||
<CustomAlertDialog
|
||||
isOpen={alert}
|
||||
|
||||
@@ -1,246 +1,118 @@
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
Drawer,
|
||||
DrawerBody,
|
||||
DrawerCloseButton,
|
||||
DrawerContent,
|
||||
DrawerFooter,
|
||||
DrawerHeader,
|
||||
DrawerOverlay,
|
||||
FormControl,
|
||||
FormLabel,
|
||||
Input,
|
||||
Text,
|
||||
Tooltip,
|
||||
useDisclosure,
|
||||
} from "@chakra-ui/react";
|
||||
import React, { useContext, useRef, useState, useEffect } from "react";
|
||||
import GlobalStateContext from "../../../Contexts/GlobalStateContext";
|
||||
import CustomAlertDialog from "../../../Components/CustomAlertDialog";
|
||||
import { MdHistory } from "react-icons/md";
|
||||
import React, { useState } from "react";
|
||||
import { Link, useParams } from "react-router-dom";
|
||||
import { useGetCurrencyHistoryByIdQuery } from "../../../Services/exchange.rate.service";
|
||||
import { Badge, Box, Button, HStack, Input, Text } from "@chakra-ui/react";
|
||||
import FullscreenLoaders from "../../../Components/Loaders/FullscreenLoaders";
|
||||
import { OPACITY_ON_LOAD } from "../../../Layout/animations";
|
||||
import NormalTable from "../../../Components/DataTable/NormalTable";
|
||||
import Pagination from "../../../Components/Pagination";
|
||||
import { AddIcon } from "@chakra-ui/icons";
|
||||
|
||||
// Convert date to YYYY-MM-DD format
|
||||
const formatDate = (dateString) => {
|
||||
if (!dateString) return "Invalid Date";
|
||||
let date = new Date(dateString);
|
||||
if (isNaN(date.getTime())) {
|
||||
// Try to handle different formats
|
||||
const parts = dateString.split(/[- :]/);
|
||||
if (parts.length >= 3) {
|
||||
date = new Date(parts[0], parts[1] - 1, parts[2]);
|
||||
}
|
||||
}
|
||||
if (isNaN(date.getTime())) {
|
||||
return "Invalid Date";
|
||||
}
|
||||
const options = {
|
||||
weekday: "short",
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
};
|
||||
return date.toLocaleDateString("en-US", options);
|
||||
};
|
||||
const ExchangeHistroy = () => {
|
||||
const params = useParams();
|
||||
const id = params?.id;
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
|
||||
const ExchangeHistory = ({ id, setIsLoading, history }) => {
|
||||
const btnRef = useRef();
|
||||
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||
const { rateExchange, setRateExchange } = useContext(GlobalStateContext);
|
||||
const { data, isLoading, errors } = useGetCurrencyHistoryByIdQuery(id, {
|
||||
skip: !id,
|
||||
});
|
||||
|
||||
const foundObject = rateExchange.find((item) => item.id === id);
|
||||
console.log(data?.data);
|
||||
|
||||
const [effectFrom, setEffectFrom] = useState("");
|
||||
const [effectTill, setEffectTill] = useState("");
|
||||
const [newRate, setNewRate] = useState("");
|
||||
const [alert, setAlert] = useState(false);
|
||||
// ==============================[Table Filter]========================
|
||||
|
||||
useEffect(() => {
|
||||
if (foundObject) {
|
||||
setEffectFrom(formatDate(foundObject.effectFrom));
|
||||
// setEffectTill(formatDate(foundObject.effectTill));
|
||||
setNewRate(foundObject.rate);
|
||||
}
|
||||
}, [foundObject]);
|
||||
const filteredData = data?.data?.filter((item) => {
|
||||
const name = item?.fromCurrency?.currencyName;
|
||||
const searchLower = searchTerm?.toLowerCase();
|
||||
const nameMatches = name?.toLowerCase().includes(searchLower);
|
||||
return nameMatches;
|
||||
});
|
||||
|
||||
// const handleSave = () => {
|
||||
// setIsLoading(true);
|
||||
// const updatedExchange = rateExchange.map((item) =>
|
||||
// item.id === id
|
||||
// ? {
|
||||
// ...item,
|
||||
// effectFrom: new Date(effectFrom),
|
||||
// rate: parseFloat(newRate),
|
||||
// }
|
||||
// : item
|
||||
// );
|
||||
// setTimeout(() => {
|
||||
// setRateExchange(updatedExchange);
|
||||
// setIsLoading(false);
|
||||
// setAlert(false);
|
||||
// onClose();
|
||||
// }, 100);
|
||||
// setIsLoading(true);
|
||||
// };
|
||||
// ====================================================[Table Setup]================================================================
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip
|
||||
rounded={"sm"}
|
||||
fontSize={"xs"}
|
||||
label="History"
|
||||
bg="#fff"
|
||||
color={"purple.500"}
|
||||
placement="top"
|
||||
>
|
||||
<Button
|
||||
ref={btnRef}
|
||||
onClick={onOpen}
|
||||
_hover={{ color: "purple.500" }}
|
||||
// transition={"0.5s all"}
|
||||
color="purple.400"
|
||||
rounded={"sm"}
|
||||
size={{base:'xs', lg:'xs'}}
|
||||
const tableHeadRow = ["From date", "To date", "Currency"];
|
||||
|
||||
|
||||
display={'flex'}
|
||||
alignItems={'center'}
|
||||
gap={1}
|
||||
|
||||
const extractedArray = filteredData?.map((item) => ({
|
||||
"From date": (
|
||||
<Text
|
||||
justifyContent={"left"}
|
||||
as={"span"}
|
||||
color={"teal.900"}
|
||||
fontWeight={"500"}
|
||||
pt={1}
|
||||
pb={1}
|
||||
className="d-flex align-items-center web-text-small"
|
||||
>
|
||||
<MdHistory /> View history
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Drawer
|
||||
size={"md"}
|
||||
isOpen={isOpen}
|
||||
placement="right"
|
||||
onClose={onClose}
|
||||
finalFocusRef={btnRef}
|
||||
>
|
||||
<DrawerOverlay />
|
||||
<DrawerContent>
|
||||
<DrawerCloseButton />
|
||||
<DrawerHeader fontSize={"md"}>Exchange History</DrawerHeader>
|
||||
{item.effectiveFrom}
|
||||
</Text>
|
||||
),
|
||||
|
||||
<DrawerBody>
|
||||
{/* <FormControl mb={4}>
|
||||
<FormLabel fontSize={"sm"}>Previous exchange rate</FormLabel>
|
||||
<Text fontSize={"sm"}>{foundObject?.rate}</Text>
|
||||
</FormControl> */}
|
||||
"To date": (
|
||||
<Box w={"auto"} isTruncated={true}>
|
||||
<Text as={"span"} color={"teal.900"} fontWeight={"500"}>
|
||||
{item.effectiveTill}
|
||||
</Text>
|
||||
</Box>
|
||||
),
|
||||
|
||||
<Box mt={4}>
|
||||
{history &&
|
||||
history.map((entry, index) => {
|
||||
// console.log("entry:", entry);
|
||||
return (
|
||||
<>
|
||||
{id === entry.id ? (
|
||||
<Box key={index}>
|
||||
<Box
|
||||
mt={2}
|
||||
display={"flex"}
|
||||
alignItems={"end"}
|
||||
justifyContent={"space-between"}
|
||||
>
|
||||
<Box>
|
||||
<Text fontSize={"sm"} marginBottom={"0px"}>
|
||||
<strong>Previous Rate:</strong>
|
||||
</Text>
|
||||
<Text fontSize={"sm"}>
|
||||
{entry.previousRate}{" "}
|
||||
<Text as={"span"} fontSize={"sm"}>
|
||||
{foundObject?.toCurr}
|
||||
</Text>
|
||||
</Text>
|
||||
</Box>
|
||||
Currency: (
|
||||
<Box w={"auto"} isTruncated={true}>
|
||||
<Text as={"span"} color={"teal.900"} fontWeight={"500"}>
|
||||
{item.rate}
|
||||
</Text>
|
||||
</Box>
|
||||
),
|
||||
}));
|
||||
|
||||
<Box>
|
||||
<Text fontSize={"sm"} marginBottom={"0px"}>
|
||||
<strong>Effect Till:</strong>
|
||||
</Text>
|
||||
<Text fontSize={"sm"}>
|
||||
{formatDate(entry.effectFrom)}
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
return isLoading ? (
|
||||
<FullscreenLoaders />
|
||||
) : (
|
||||
<Box {...OPACITY_ON_LOAD} overflowY={"scroll"} height={"100vh"} pb={38}>
|
||||
<Box bg="white.500">
|
||||
<HStack
|
||||
display={"flex"}
|
||||
justifyContent={"space-between"}
|
||||
ps={1}
|
||||
pe={1}
|
||||
pb={4}
|
||||
pt={4}
|
||||
spacing="24px"
|
||||
>
|
||||
{/* =======================[Search Input]======================== */}
|
||||
<Box fontSize={'md'}>
|
||||
History :-{" "}
|
||||
<Badge me={1} fontSize={"sm"} colorScheme="forestGreen">
|
||||
{data?.data?.[0]?.fromCurrency?.currencyCode}
|
||||
</Badge>{" "}
|
||||
to
|
||||
<Badge ms={2} fontSize={"sm"} colorScheme="forestGreen">
|
||||
{data?.data?.[0]?.toCurrency?.currencyCode}
|
||||
</Badge>
|
||||
</Box>
|
||||
|
||||
<Box
|
||||
display={"flex"}
|
||||
alignItems={"end"}
|
||||
justifyContent={"space-between"}
|
||||
>
|
||||
<Box>
|
||||
<Text fontSize={"sm"} marginBottom={"0px"}>
|
||||
<strong>New Rate:</strong>
|
||||
</Text>
|
||||
<Text fontSize={"sm"}>
|
||||
{" "}
|
||||
{entry?.newRate}{" "}
|
||||
<Text as={"span"} fontSize={"sm"}>
|
||||
{foundObject?.toCurr}
|
||||
</Text>
|
||||
</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Text fontSize={"sm"} marginBottom={"0px"}>
|
||||
<strong>Effect From:</strong>
|
||||
</Text>
|
||||
<Text fontSize={"sm"}>
|
||||
{formatDate(entry.effectFrom)}
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</>
|
||||
);
|
||||
})}
|
||||
<Input
|
||||
type="search"
|
||||
width={300}
|
||||
placeholder="Search..."
|
||||
size="sm"
|
||||
rounded="sm"
|
||||
focusBorderColor="green.500"
|
||||
value={searchTerm}
|
||||
onChange={(e) => setSearchTerm(e.target.value)}
|
||||
/>
|
||||
</HStack>
|
||||
</Box>
|
||||
|
||||
{/* <Text fontSize={"sm"} marginBottom={"0px"}>
|
||||
<strong>New Rate:</strong>
|
||||
</Text>
|
||||
<Text fontSize={"sm"}>
|
||||
{" "}
|
||||
{foundObject?.rate} {foundObject?.toCurr}
|
||||
</Text> */}
|
||||
</Box>
|
||||
</DrawerBody>
|
||||
{/* =================== [Data Table] ===================== */}
|
||||
|
||||
<DrawerFooter>
|
||||
<Button
|
||||
variant="outline"
|
||||
colorScheme={"green"}
|
||||
rounded={"sm"}
|
||||
size={"sm"}
|
||||
mr={3}
|
||||
onClick={onClose}
|
||||
>
|
||||
Close
|
||||
</Button>
|
||||
{/*
|
||||
<Button
|
||||
colorScheme={"green"}
|
||||
rounded={"sm"}
|
||||
size={"sm"}
|
||||
onClick={() => setAlert(true)}
|
||||
>
|
||||
Save
|
||||
</Button> */}
|
||||
</DrawerFooter>
|
||||
</DrawerContent>
|
||||
</Drawer>
|
||||
|
||||
<CustomAlertDialog
|
||||
isOpen={alert}
|
||||
onClose={() => setAlert(false)}
|
||||
// alertHandler={handleSave}
|
||||
message={"Are you sure you want to update rates?"}
|
||||
<NormalTable
|
||||
emptyMessage={`We don't have any Sponers `}
|
||||
tableHeadRow={tableHeadRow}
|
||||
data={extractedArray}
|
||||
isLoading={isLoading}
|
||||
/>
|
||||
</>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default ExchangeHistory;
|
||||
export default ExchangeHistroy;
|
||||
|
||||
@@ -21,7 +21,7 @@ import React, { useContext, useEffect, useState } from "react";
|
||||
import { OPACITY_ON_LOAD } from "../../../Layout/animations";
|
||||
import DataTable from "../../../Components/DataTable/DataTable";
|
||||
import { HiDotsVertical } from "react-icons/hi";
|
||||
import { Link, Link as RouterLink } from "react-router-dom";
|
||||
import { Link, Link as RouterLink, useNavigate } from "react-router-dom";
|
||||
import { AddIcon, EmailIcon } from "@chakra-ui/icons";
|
||||
import Pagination from "../../../Components/Pagination";
|
||||
import GlobalStateContext from "../../../Contexts/GlobalStateContext";
|
||||
@@ -33,9 +33,11 @@ import ExchangeHistory from "./ExchangeHistroy";
|
||||
import { useGetAllExchangeRatesQuery } from "../../../Services/exchange.rate.service";
|
||||
import { TABLE_PAGINATION } from "../../../Constants/Paginations";
|
||||
import NormalTable from "../../../Components/DataTable/NormalTable";
|
||||
import { MdHistory } from "react-icons/md";
|
||||
|
||||
const ExchangeRate = () => {
|
||||
const toast = useToast();
|
||||
const navigate = useNavigate()
|
||||
const { slideFromRight, rateExchange, setRateExchange } =
|
||||
useContext(GlobalStateContext);
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
@@ -163,11 +165,32 @@ const ExchangeRate = () => {
|
||||
id={item.id}
|
||||
updateHistory={updateHistory}
|
||||
/>
|
||||
<ExchangeHistory
|
||||
setIsLoading={setIsLoading}
|
||||
id={item.id}
|
||||
history={history}
|
||||
/>
|
||||
|
||||
<Tooltip
|
||||
rounded={"sm"}
|
||||
fontSize={"xs"}
|
||||
label="History"
|
||||
bg="#fff"
|
||||
color={"purple.500"}
|
||||
placement="top"
|
||||
>
|
||||
<Button
|
||||
// _hover={{ color: "purple.500" }}
|
||||
// transition={"0.5s all"}
|
||||
// color="purple.400"
|
||||
colorScheme="purple"
|
||||
rounded={"sm"}
|
||||
size={{base:'xs', lg:'xs'}}
|
||||
onClick={() => navigate(`currency-history/${item?.id}`)}
|
||||
|
||||
display={'flex'}
|
||||
alignItems={'center'}
|
||||
gap={1}
|
||||
|
||||
>
|
||||
<MdHistory />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</Box>
|
||||
),
|
||||
}));
|
||||
|
||||
@@ -142,14 +142,15 @@ const InvestmentType = () => {
|
||||
placement="top"
|
||||
>
|
||||
<Button
|
||||
_hover={{ color: "green.500" }}
|
||||
// _hover={{ color: "green.500" }}
|
||||
transition={"0.5s all"}
|
||||
onClick={() => {
|
||||
navigate(`view-investment/${item.id}`);
|
||||
}}
|
||||
color="green.300"
|
||||
// color="green.300"
|
||||
rounded={"sm"}
|
||||
size={"xs"}
|
||||
colorScheme="green"
|
||||
>
|
||||
<ViewIcon />
|
||||
</Button>
|
||||
@@ -167,8 +168,9 @@ const InvestmentType = () => {
|
||||
onClick={() =>
|
||||
navigate(`/investment-type/add-investment/${item.id}`)
|
||||
}
|
||||
_hover={{ color: "blue.500" }}
|
||||
color="blue.400"
|
||||
// _hover={{ color: "blue.500" }}
|
||||
// color="blue.400"
|
||||
colorScheme="blue"
|
||||
rounded={"sm"}
|
||||
size={"xs"}
|
||||
>
|
||||
@@ -189,8 +191,9 @@ const InvestmentType = () => {
|
||||
setActionId(item?.id);
|
||||
setDeleteAlert(true);
|
||||
}}
|
||||
_hover={{ color: "red.500" }}
|
||||
color="red.300"
|
||||
// _hover={{ color: "red.500" }}
|
||||
// color="red.300"
|
||||
colorScheme="red"
|
||||
rounded={"sm"}
|
||||
size={"xs"}
|
||||
>
|
||||
|
||||
@@ -113,10 +113,11 @@ const Sponser = () => {
|
||||
>
|
||||
<Button
|
||||
onClick={() => navigate(`/sponser/add-sponser/${item.id}`)}
|
||||
_hover={{ color: "blue.500" }}
|
||||
color="blue.400"
|
||||
// _hover={{ color: "blue.500" }}
|
||||
// color="blue.400"
|
||||
rounded={"sm"}
|
||||
size={"xs"}
|
||||
colorScheme="blue"
|
||||
>
|
||||
<EditIcon />
|
||||
</Button>
|
||||
@@ -128,6 +129,7 @@ const Sponser = () => {
|
||||
label="Delete"
|
||||
bg="#fff"
|
||||
color={"red.500"}
|
||||
|
||||
placement="top"
|
||||
>
|
||||
<Button
|
||||
@@ -135,12 +137,14 @@ const Sponser = () => {
|
||||
setActionId(item?.id);
|
||||
setDeleteAlert(true);
|
||||
}}
|
||||
_hover={{ color: "red.500" }}
|
||||
color="red.300"
|
||||
// _hover={{ color: "red.500" }}
|
||||
// color="red"
|
||||
rounded={"sm"}
|
||||
size={"xs"}
|
||||
colorScheme="red"
|
||||
variant={'solid'}
|
||||
>
|
||||
<DeleteIcon />
|
||||
<DeleteIcon />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</Box>
|
||||
|
||||
@@ -1,22 +1,16 @@
|
||||
|
||||
import DeletionHistory from "../Pages/AccountDeletion/DeletionHistory";
|
||||
import DeletionRequest from "../Pages/AccountDeletion/DeletionRequest";
|
||||
// import Academy from "../Pages/Admin/Academy";
|
||||
import BankDetails from "../Pages/Admin/BankDetails/BankDetails";
|
||||
import BankInvestor from "../Pages/Admin/BankInvestor";
|
||||
import Contact from "../Pages/Admin/Contact";
|
||||
import Notification from "../Pages/Admin/Notification";
|
||||
import Users from "../Pages/Admin/Users";
|
||||
import CreateIO from "../Pages/IO_Management/CreateIO/CreateIO";
|
||||
// import CreateIO from "../Pages/IO_Management/InputComponents";
|
||||
import Create from "../Pages/IO_Management/InputComponents";
|
||||
import ViewIO from "../Pages/IO_Management/ViewIO/ViewIO";
|
||||
import View from "../Pages/IO_Management/ViewIO/ViewIO";
|
||||
import ViewIOTable from "../Pages/IO_Management/ViewIO/ViewIOTable";
|
||||
import ViewIOdata from "../Pages/IO_Management/ViewIO/ViewIOdata";
|
||||
import InvestorPendingRequest from "../Pages/InvestorUpgrade/InvestorRequest";
|
||||
import UpgradeHistory from "../Pages/InvestorUpgrade/UpgradeHistory";
|
||||
import upgradeHistory from "../Pages/InvestorUpgrade/UpgradeHistory";
|
||||
import InvestorDetails from "../Pages/Investor_Management/InvestorDetails/InvestorDetails";
|
||||
import InvestorTransactions from "../Pages/Investor_Management/InvestorTransactions";
|
||||
import ProfileView from "../Pages/Investor_Management/InvestorDetails/ProfileView";
|
||||
@@ -24,7 +18,6 @@ import ViewInvestorDetails from "../Pages/Investor_Management/InvestorDetails/Vi
|
||||
import ExchangeRate from "../Pages/Master/ExchangeRate/ExchangeRate";
|
||||
import AddInvestmentType from "../Pages/Master/InvestmentType/AddInvestmentType";
|
||||
import EditInvestmentType from "../Pages/Master/InvestmentType/EditInvestmentType";
|
||||
// import InvestmentType from "../Pages/Master/InvestmentType/InvestmentTypeOld";
|
||||
import ViewInvestmentType from "../Pages/Master/InvestmentType/ViewInvestmentType";
|
||||
import AddSponser from "../Pages/Master/Sponser/AddSponser";
|
||||
import EditSponser from "../Pages/Master/Sponser/EditSponser";
|
||||
@@ -32,12 +25,12 @@ import Sponser from "../Pages/Master/Sponser/Sponsers";
|
||||
import ViewSponser from "../Pages/Master/Sponser/ViewSponser";
|
||||
import PendingRequest from "../Pages/WithDrawal/PendingRequest";
|
||||
import ViewHistory from "../Pages/WithDrawal/DrawalView/ViewHistory";
|
||||
// import DepositRequest from "../Pages/Deposit/DepositRequest";
|
||||
import DepositHistory from "../Pages/Deposit/DepositViewHistory/DepositHistory";
|
||||
import Academy from "../Pages/Admin/ManageAcademy/Academy";
|
||||
import InvestmentType from "../Pages/Master/InvestmentType/InvestmentType";
|
||||
import DepositRequest from "../Pages/Deposit/DepositRequest/DepositRequest";
|
||||
import EditBankDetails from "../Pages/Admin/BankDetails/EditBankDetails";
|
||||
import ExchangeHistory from "../Pages/Master/ExchangeRate/ExchangeHistroy";
|
||||
|
||||
export const RouteLink = [
|
||||
// =============[ Tanami ]================
|
||||
@@ -50,10 +43,13 @@ export const RouteLink = [
|
||||
{ path: "/sponser/view-sponser/:id", Component: ViewSponser },
|
||||
{ path: "/sponser/edit-sponser/:id", Component: EditSponser },
|
||||
|
||||
|
||||
|
||||
|
||||
{ path: "/exchange-rate", Component: ExchangeRate },
|
||||
{ path: "/exchange-rate/currency-history/:id", Component: ExchangeHistory },
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{ path: "/investment-type", Component: InvestmentType },
|
||||
{ path: "/investment-type/add-investment/:id", Component: AddInvestmentType },
|
||||
{ path: "/investment-type/add-investment", Component: AddInvestmentType },
|
||||
|
||||
@@ -30,6 +30,14 @@ export const exchangeRate = createApi({
|
||||
}),
|
||||
invalidatesTags: ["getAllExchangeRate"],
|
||||
}),
|
||||
|
||||
getCurrencyHistoryById: builder.query({
|
||||
query: (id) => `/currencyExchange/admin/history/${id}`,
|
||||
providesTags: ["getAllExchangeRate"],
|
||||
}),
|
||||
|
||||
|
||||
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -38,4 +46,5 @@ export const {
|
||||
useGetAllExchangeRatesQuery,
|
||||
useGetExchangeRateByIdQuery,
|
||||
useUpdateExchangeRateMutation,
|
||||
useGetCurrencyHistoryByIdQuery,
|
||||
} = exchangeRate;
|
||||
|
||||
BIN
src/assets/propic.png
Normal file
BIN
src/assets/propic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
Reference in New Issue
Block a user