updated Kyc

This commit is contained in:
YasinShaikh123
2024-10-04 18:06:38 +05:30
parent bb724d88d1
commit 149667436e
7 changed files with 95 additions and 15 deletions

View File

@@ -69,6 +69,7 @@ const FormField = ({
align,
maxLength,
dateValue,
closingDate,
...props
}) => (
<FormControl
@@ -464,7 +465,7 @@ const FormField = ({
} else if(type === 'date'){
return (
<Input
position={'relative'}
position={'relative'}
bg={"#F5F8F6"}
focusBorderColor="forestGreen.300"
size={"sm"}
@@ -481,7 +482,7 @@ const FormField = ({
// defaultValue={type === "date" && "2023-07-26" : undefined}
// defaultValue={value}
// value={dateValue}
min={closingDate ? new Date().toISOString().split("T")[0] : undefined}
/>
);

View File

@@ -60,7 +60,8 @@ const FormInputMain = ({
handleInputChange,
align,
maxLength,
dateValue
dateValue,
closingDate
},
key
) => (
@@ -89,6 +90,7 @@ const FormInputMain = ({
align={align}
maxLength={maxLength}
dateValue={dateValue}
closingDate={closingDate}
/>
)
)}

View File

@@ -304,12 +304,6 @@ const Notification = () => {
onSubmit={handleSubmit(onSubmit)}
btnLoading={isLoading}
>
<NormalTable
centered={true}
emptyMessage={`We don't have any Sponers `}

View File

@@ -302,9 +302,6 @@ const IODetails = ({ enableNextTab, index, data }) => {
}, [id, IObyID]);
// const minInvestmentById =
@@ -448,6 +445,7 @@ const IODetails = ({ enableNextTab, index, data }) => {
width: "32.3%",
dateValue:formatDatee(IObyID?.data?.closingDate),
// helperText: IObyID && `Current closing date is : ${formatDate(IObyID?.data?.closingDate)}`
closingDate:true
},
{
label: "ISIN",

View File

@@ -451,6 +451,7 @@ const Investors = ({ data }) => {
};
console.log(IODetails?.investors);
return (
@@ -486,7 +487,7 @@ const Investors = ({ data }) => {
fontSize={"xs"}
w={100}
me={2}
>
>
Export xls
</Button>
<Box as="span">

View File

@@ -0,0 +1,80 @@
import { Box, Checkbox, CheckboxGroup, Divider, FormControl, FormLabel, Heading, HStack, Input, Radio, RadioGroup, Select, Stack, Text, Textarea } from "@chakra-ui/react";
import React, { useState } from "react";
import { useParams } from "react-router-dom";
import { useGetInvestorsDetailsByIdQuery } from "../../../Services/investor.details.service";
const Kyc = () => {
const params = useParams();
const id = params?.id;
const { data, isLoading:bankDetailsLoading, errors, refetch } = useGetInvestorsDetailsByIdQuery(
id,{skip: !id,}
);
const [value, setValue] = useState('2')
console.log(data?.data?.KYC?.questions[0]?.question_text);
return (
(!bankDetailsLoading && <Box>
<Box mb={5}>
<Heading fontSize={"md"} fontWeight={500}>Additional Questions</Heading>
<Text fontSize={"sm"}>Please provide additional Information to complete your profile.</Text>
<HStack spacing={4} mb={4}>
<FormControl>
<FormLabel mb={1} fontSize={"sm"}>City</FormLabel>
<Input bg={"#ccc3"} border={"none"} size={"sm"} value={data?.data?.KYC?.otherInformation?.city} type="text" readOnly />
</FormControl>
<FormControl>
<FormLabel mb={1} fontSize={"sm"}>Country</FormLabel>
<Input bg={"#ccc3"} border={"none"} size={"sm"} value={data?.data?.KYC?.otherInformation?.country} type="text" readOnly />
</FormControl>
</HStack>
<HStack spacing={4} mb={4}>
<FormControl>
<FormLabel mb={1} fontSize={"sm"}>Occupation</FormLabel>
<Input bg={"#ccc3"} border={"none"} size={"sm"} value={data?.data?.KYC?.otherInformation?.occupation} type="text" readOnly />
</FormControl>
<FormControl>
<FormLabel mb={1} fontSize={"sm"}>Source of Funds</FormLabel>
<Input bg={"#ccc3"} border={"none"} size={"sm"} value={data?.data?.KYC?.otherInformation?.sourceOfFund} type="text" readOnly />
</FormControl>
</HStack>
<HStack spacing={4}>
<FormControl>
<FormLabel mb={1} fontSize={"sm"}>Address</FormLabel>
<Textarea bg={"#ccc3"} border={"none"} size={"sm"} type="textarea" resize={"none"} value={data?.data?.KYC?.otherInformation?.address} readOnly />
</FormControl>
<FormControl></FormControl>
</HStack>
</Box>
<Divider />
<Box>
<Heading fontSize={"md"} fontWeight={500}>Investor Eligibilty Notice</Heading>
<Text fontSize={"sm"}>Please note that Tanami is currently only available to qualifield or accredited investors. Please confirm your status</Text>
<RadioGroup value={value}>
{data?.data?.KYC?.questions.map((question, index) => (
<Radio value={String(index + 1)} isChecked={question?.answers} colorScheme='forestGreen' key={index}>
<Text fontSize={"sm"} mb={0}>{question?.question_text}</Text>
</Radio>
))}
</RadioGroup>
{value === '2' && (
<CheckboxGroup colorScheme='forestGreen'>
<Stack ml={8}>
{data?.data?.KYC?.questions[0]?.subQuestions?.map((subQuestion, index) => (
<Checkbox isChecked={subQuestion.answers} size="sm" key={index}>
<Text as="span">{subQuestion.question_text}</Text>
</Checkbox>
))}
</Stack>
</CheckboxGroup>
)}
</Box>
</Box>)
);
};
export default Kyc;

View File

@@ -23,6 +23,7 @@ import Transaction from "./Transaction";
import FullscreenLoaders from "../../../Components/Loaders/FullscreenLoaders";
import { useGetInvestorsDetailsByIdQuery } from "../../../Services/investor.details.service";
import BankDetails from "./BankDetails";
import Kyc from "./Kyc";
const ProfileView = () => {
const navigate = useNavigate();
@@ -323,14 +324,14 @@ const ProfileView = () => {
Transaction
</Tab>
<Tab
isDisabled={true}
// isDisabled={true}
fontSize={"sm"}
_selected={{
color: "#004118",
borderBottom: "2px solid #38a169",
}}
>
documents
KYC
</Tab>
</TabList>
</Box>
@@ -346,6 +347,9 @@ const ProfileView = () => {
<TabPanel>
<Transaction />
</TabPanel>
<TabPanel>
<Kyc />
</TabPanel>
</TabPanels>
</Tabs>
</Box>