coma updated after sprint 5

This commit is contained in:
2024-08-23 22:01:17 +05:30
parent 0db739c557
commit 3a7d174766
8 changed files with 51 additions and 66 deletions

View File

@@ -97,7 +97,7 @@ const DataTable = ({
bg: "blue.50",
cursor: "grab",
}}
bg={snapshot.isDragging ? "blue.100" : "white"}
bg={snapshot.isDragging ? "blue.100" : index % 2 ? "white" : "gray.50"}
boxShadow={snapshot.isDragging ? "0 0 1em rgba(0, 0, 0, 0.2)" : "none"}
>
@@ -121,7 +121,7 @@ const DataTable = ({
)}
</Draggable>
) : (
<Tr key={index}>
<Tr bg={index % 2 ? "gray.50" : "white"} key={index}>
{tableHeadRow.map((heading, i) => (
<Td
textAlign={tableHeadRow.length - 1 === i || centered ? "center" : "left"}

View File

@@ -36,7 +36,7 @@ const DataTable = ({
) : (
<Table size="sm">
<TableCaption p={total?0:null}>{total? total :"Tanami v1.0.0"}</TableCaption>
<Thead backgroundColor="gray.50">
<Thead backgroundColor="gray.100">
<Tr>
{tableHeadRow.map((heading, index) => (
<Th
@@ -82,7 +82,7 @@ const DataTable = ({
</Tr>
))
: data?.map((item, index) => (
<Tr key={index}>
<Tr bg={index % 2 === 0 ? "" : "gray.50"} key={index}>
{tableHeadRow.map((heading, i) => (
<Td
textAlign={

View File

@@ -24,6 +24,7 @@ import { useForm } from "react-hook-form";
import { useGetDepositRequestByIdQuery, useGetDepositRequestQuery, useUpdateDepositRequestMutation } from "../../../Services/deposit.request.service";
import FullscreenLoaders from "../../../Components/Loaders/FullscreenLoaders";
import ToastBox from "../../../Components/ToastBox";
import { formatCurrency } from "../../../Components/CurrencyInput";
const FILE_TYPES = ["image/jpeg", "image/png", "image/gif"];
@@ -41,8 +42,7 @@ const DepositRequestApprove = ({ isOpen, onClose, firstField, id, data:requestDa
const [file, setFile] = useState();
const [isBtnLoading , setIsBtnLoading] = useState(false)
const fileredData = requestData?.find((item)=> item?.id === id)
console.log(fileredData);
@@ -51,25 +51,30 @@ const DepositRequestApprove = ({ isOpen, onClose, firstField, id, data:requestDa
skip: !id,
});
console.log(data?.data?.investorAmount);
const {
register,
reset,
watch,
handleSubmit,
formState: { errors },
} = useForm({
resolver: yupResolver(conformModalSchema),
});
useEffect(() => {
reset({
investorAmount:fileredData?.investorAmount
})
}, [requestData, id])
useEffect(() => {
if (data) {
const investorAmount = parseFloat(data?.data?.investorAmount);
reset({
investorAmount: investorAmount,
accountName: data?.data?.accountName,
});
}
}, [id, data, reset]);
const onSubmit = async(data) => {
setIsBtnLoading(true)
@@ -108,20 +113,6 @@ const DepositRequestApprove = ({ isOpen, onClose, firstField, id, data:requestDa
heandleOnClose();
};
const handleFileChange = (event) => {
const selectedFile = event.target.files[0];
setFile(selectedFile);
};
useEffect(() => {
if (data) {
reset({
investorAmount: data?.data?.investorAmount,
accountName:data?.data?.accountName
});
}
}, [data, reset]);
const heandleOnClose = () =>{
reset()
@@ -141,11 +132,13 @@ const DepositRequestApprove = ({ isOpen, onClose, firstField, id, data:requestDa
<Box as="form" onSubmit={handleSubmit(onSubmit)}>
<ModalBody>
<FormControl mb={4} isRequired>
<FormLabel fontSize="sm">Deposit Amount <Badge colorScheme="green">{fileredData?.currencyCode}</Badge></FormLabel>
<FormLabel fontSize="sm">Deposit Amount <Badge colorScheme="green">{data?.data?.currencyCode}</Badge></FormLabel>
<Input
focusBorderColor="green.400"
name="investorAmount"
{...register("investorAmount")}
// value={formatCurrency(watch('investorAmount'))}
fontSize="sm"
type="number"
size="sm"

View File

@@ -190,7 +190,8 @@ const filteredData = data?.data?.rows
<Box w={"100px"} isTruncated={true}>
<Text as={"span"} color={"teal.900"}>
{/* <Badge px={2} py={1}> */}
{item?.investorAmount} <Badge ms={1} colorScheme="green">{item?.currencyCode}</Badge>
{parseFloat(item?.investorAmount||0).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} <Badge ms={1} colorScheme="green">{item?.currencyCode}</Badge>
{/* </Badge> */}
</Text>
</Box>

View File

@@ -55,13 +55,13 @@ import {
// ====================================================[Table Setup]================================================================
const tableHeadRow = [
"Sr N/O",
// "Sr N/O",
"Date",
"Transaction",
"Currency",
"Amount",
// "Currency",
"From USD",
"TO USD",
"Amount in investors currency",
"USD amount",
"IO Name",
"Payment Method",
@@ -126,10 +126,11 @@ console.log(transaction);
</Text>
</Box>
),
"Amount": (
<Box w={"auto"} isTruncated={true}>
"Amount in investors currency": (
<Box w={"120px"} isTruncated={true}>
<Text as={"span"} color={"teal.900"}>
{item.investorAmount}
{parseFloat(item?.investorAmount||0).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}
<Badge ms={1} colorScheme="green">{item?.investorCurrency}</Badge>
</Text>
</Box>
),
@@ -150,7 +151,7 @@ console.log(transaction);
"USD amount": (
<Box w={"auto"} isTruncated={true}>
<Text as={"span"} color={"teal.900"}>
{item.USDAmount}
${parseFloat(item?.USDAmount||0).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}
</Text>
</Box>
),

View File

@@ -60,7 +60,7 @@ const ViewInvestorDetails = () => {
// ====================================================[Table Setup]================================================================
const tableHeadRow = [
"Sr N/O",
// "Sr N/O",
"Deal Name",
"Sponsor Name",
"Investment Amount",

View File

@@ -97,7 +97,7 @@ const PendingRequest = () => {
// ====================================================[Table Setup]================================================================
const tableHeadRow = [
"Sr.no",
// "Sr.no",
"Date",
"Client ID",
"First Name",
@@ -105,7 +105,6 @@ const PendingRequest = () => {
"Country",
"Phone Number",
"Amount in Investor currency",
"Currency",
"Withdrawal Amount",
"Action",
];
@@ -151,7 +150,7 @@ const PendingRequest = () => {
</Text>
),
"First Name": (
<Box isTruncated={true} w={'50px'}>
<Box isTruncated={true} w={'90px'}>
<Text as={"span"} color={"teal.900"} fontWeight={"500"}>
{item.firstName}
</Text>
@@ -181,7 +180,6 @@ const PendingRequest = () => {
Currency: (
<Box w={"60px"} isTruncated={true}>
<Text as={"span"} color={"teal.900"}>
{/* {parseFloat(item?.investorAmount||0).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} */}
<Badge ms={1} colorScheme="green">{item?.currencyCode}</Badge>
</Text>
</Box>
@@ -189,14 +187,14 @@ const PendingRequest = () => {
"Withdrawal Amount": (
<Box w={"80px"} isTruncated={true}>
<Text as={"span"} color={"teal.900"}>
{item.USDAmount}💲
${parseFloat(item?.USDAmount||0).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}
</Text>
</Box>
),
"Amount in Investor currency": (
<Box w={"70px"} isTruncated={true}>
<Box isTruncated={true}>
<Text as={"span"} color={"teal.900"}>
{item.investorAmount}
{parseFloat(item?.investorAmount||0).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}<Badge ms={1} colorScheme="green">{item?.currencyCode}</Badge>
</Text>
</Box>
),

View File

@@ -65,15 +65,7 @@ const ViewHistory = () => {
// console.log(data?.data?.rows);
useEffect(() => {
// Simulate loading
const timer = setTimeout(() => {
setIsLoading(false);
}, 1500);
// Cleanup the timer on component unmount
return () => clearTimeout(timer);
}, []);
// ====================================================[Table Filter]================================================================
const filteredData = data?.data?.rows.filter((item) => {
@@ -96,16 +88,16 @@ const ViewHistory = () => {
// ====================================================[Table Setup]================================================================
const tableHeadRow = [
"Sr.no",
// "Sr.no",
"Date",
"Client ID",
"First Name",
"Last Name",
"Country",
"Phone Number",
"Currency",
"Withdrawal Amount",
// "Currency",
"Amount in Investor currency",
"Withdrawal Amount",
"Status",
];
@@ -148,35 +140,35 @@ const ViewHistory = () => {
</Text>
),
"First Name": (
<Box isTruncated={true} w={"50px"}>
<Box isTruncated={true} >
<Text as={"span"} color={"teal.900"} fontWeight={"500"}>
{item.firstName}
</Text>
</Box>
),
"Last Name": (
<Box w={"50px"} isTruncated={true}>
<Box w={"70px"} isTruncated={true}>
<Text as={"span"} color={"teal.900"}>
{item.lastName}
</Text>
</Box>
),
Country: (
<Box w={"70px"} isTruncated={true}>
<Box isTruncated={true}>
<Text as={"span"} color={"teal.900"}>
{item.countryName}
</Text>
</Box>
),
"Phone Number": (
<Box w={"70px"} isTruncated={true}>
<Box isTruncated={true}>
<Text as={"span"} color={"teal.900"}>
{item.mobileNumber}
</Text>
</Box>
),
Currency: (
<Box w={"50px"} isTruncated={true}>
<Box isTruncated={true}>
<Text as={"span"} color={"teal.900"}>
<Badge ms={1} colorScheme="green">
{item.currencyCode}
@@ -185,16 +177,16 @@ const ViewHistory = () => {
</Box>
),
"Withdrawal Amount": (
<Box w={"50px"} isTruncated={true}>
<Box isTruncated={true}>
<Text as={"span"} color={"teal.900"}>
{item.USDAmount}
${parseFloat(item?.USDAmount||0).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}
</Text>
</Box>
),
"Amount in Investor currency": (
<Box w={"70px"} isTruncated={true}>
<Box w={"100px"} isTruncated={true}>
<Text as={"span"} color={"teal.900"}>
{item.investorAmount}
{parseFloat(item?.investorAmount||0).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}<Badge ms={1} colorScheme="green">{item?.currencyCode}</Badge>
</Text>
</Box>
),
@@ -279,7 +271,7 @@ const ViewHistory = () => {
emptyMessage={`We don't have any Sponers `}
tableHeadRow={tableHeadRow}
data={extractedArray}
isLoading={isLoading}
isLoading={drawalHistoryLoading}
viewActionId={actionId}
setViewActionId={setActionId}
// totalPages={10}