This commit is contained in:
YasinShaikh123
2024-08-05 17:57:43 +05:30
9 changed files with 107 additions and 129 deletions

View File

@@ -35,7 +35,6 @@ const DataTable = ({
<Tr>
{tableHeadRow.map((heading, index) => (
<Th
width={'fit-content'}
textAlign={
tableHeadRow.length - 1 === index || centered
? "center"
@@ -43,7 +42,11 @@ const DataTable = ({
}
key={index}
p={3}
w={columnWidth}
width="120px" // Adjust width as needed
color={"#004118"}
whiteSpace="normal" // Allow text to wrap
wordBreak="normal" // Ensure long words break properly
overflowWrap="normal" // Break long words if necessary
>
{isLoading ? <Skeleton height="20px" /> : heading}
{/* {heading} */}

View File

@@ -30,7 +30,7 @@ import { AddIcon, CloseIcon } from "@chakra-ui/icons";
const today = new Date().toISOString().split("T")[0];
const formatDate = (dateString) => {
export const formatDatee = (dateString) => {
const date = new Date(dateString);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0"); // Months are zero-based
@@ -41,7 +41,7 @@ const formatDate = (dateString) => {
const defaultDate = "8/2/2024";
// Format the default date as YYYY-MM-DD
const formattedDate = formatDate(defaultDate);
const formattedDate = formatDatee(defaultDate);
const FormField = ({
label,
@@ -67,12 +67,13 @@ const FormField = ({
handleInputChange,
align,
maxLength,
dateValue,
...props
}) => (
<FormControl
w={width ? width : "49%"}
isInvalid={errors[name]}
isRequired={isRequired}
isRequired={type === "date" ? false: isRequired}
mb={2}
>
<FormLabel textAlign={"left"} fontSize={"xs"} color={"gray.600"}>
@@ -460,7 +461,31 @@ const FormField = ({
</Tbody>
</Table>
);
} else {
} else if(type === 'date'){
return (
<Input
position={'relative'}
bg={"#F5F8F6"}
focusBorderColor="forestGreen.300"
size={"sm"}
fontSize={"sm"}
rounded={"sm"}
type={"date"}
{...field}
{...props}
placeholder={placeHolder ? placeHolder : label}
textAlign={arabic || type === "number" ? "right" : align ? align : "left"}
_placeholder={{ fontSize: "sm" }}
min={type === "date" ? today : undefined}
maxLength={maxLength}
// defaultValue={type === "date" && "2023-07-26" : undefined}
// defaultValue={value}
// defaultValue={dateValue}
/>
);
} else{
return (
<Input
bg={"#F5F8F6"}
@@ -474,7 +499,7 @@ const FormField = ({
placeholder={placeHolder ? placeHolder : label}
textAlign={arabic || type === "number" ? "right" : align ? align : "left"}
_placeholder={{ fontSize: "sm" }}
min={type === "date" ? today : undefined}
// min={type === "date" ? today : undefined}
maxLength={maxLength}
// defaultValue={type === "date" && "2023-07-26" : undefined}
// value={"2023-07-26"}

View File

@@ -59,7 +59,8 @@ const FormInputMain = ({
value,
handleInputChange,
align,
maxLength
maxLength,
dateValue
},
key
) => (
@@ -83,10 +84,11 @@ const FormInputMain = ({
handleImageChange={handleImageChange}
removeImage={removeImage}
width={width}
value={type === "date" ? null :value}
value={value}
handleInputChange={handleInputChange}
align={align}
maxLength={maxLength}
dateValue={dateValue}
/>
)
)}

View File

@@ -33,6 +33,7 @@ import oman from "../../../assets/oman_flag.png";
import qatar from "../../../assets/qatar_flag.png";
import uae from "../../../assets/uae_flag.png";
import saudi from "../../../assets/saudi_arabia_flag.png";
import { formatDatee } from "../../../Components/FormField";
const schema = yup.object().shape({
investmentNameEnglish: yup
@@ -288,11 +289,12 @@ const IODetails = ({ enableNextTab, index, data }) => {
{
label: "Closing Date",
name: "closingDate",
value: formatDate(IObyID?.data?.closingDate),
// value: "IObyID?.data?.closingDate",
type: "date",
isRequired: true,
section: " ",
width: "32.3%",
// dateValue:IObyID?.data?.closingDate,
helperText: IObyID && `Current closing date is : ${formatDate(IObyID?.data?.closingDate)}`
},
{

View File

@@ -19,7 +19,7 @@ export const formatDate = (date) => {
const month = String(d.getMonth() + 1).padStart(2, '0'); // Months are 0-indexed
const day = String(d.getDate()).padStart(2, '0');
return `${day}-${month}-${year}`;
return `${day}/${month}/${year}`;
};
const Sponser = () => {

View File

@@ -3,7 +3,7 @@ import axios from "axios";
// Create an Axios instance for API calls
export const api = axios.create({
// baseURL: `https://tanami.betadelivery.com/api/v1`,
baseURL: `https://tanami.betadelivery.com/api/v1`, // Replace with your API base URL
baseURL: `https://sprint4.tanami.betadelivery.com/api/v1`, // Replace with your API base URL
timeout: 10000, // Adjust timeout as needed
headers: {
"Content-Type": "application/json",

View File

@@ -8,7 +8,8 @@ const baseUrl = api?.defaults.baseURL;
export const bankDetails = createApi({
reducerPath: "bankDetails",
baseQuery: fetchBaseQuery({ baseUrl }),
tagTypes: [],
tagTypes: ["getBank"],
endpoints: (builder) => ({
getBank: builder.query({
@@ -25,7 +26,7 @@ export const bankDetails = createApi({
method: "PATCH",
body: data,
}),
invalidatesTags: ["getBankDetails"],
invalidatesTags: ["getBank"],
}),
}),