filal update
This commit is contained in:
@@ -98,7 +98,6 @@ const FormField = ({
|
||||
textAlign={arabic ? "right" : "left"}
|
||||
_placeholder={{ fontSize: "sm" }}
|
||||
rounded={"sm"}
|
||||
// defaultValue={value}
|
||||
>
|
||||
{options.map((option, index) => (
|
||||
<option key={index} value={option.value}>
|
||||
@@ -476,7 +475,9 @@ const FormField = ({
|
||||
textAlign={arabic || type === "number" ? "right" : align ? align : "left"}
|
||||
_placeholder={{ fontSize: "sm" }}
|
||||
min={type === "date" ? today : undefined}
|
||||
defaultValue={type === "date" ? new Date(value) : undefined}
|
||||
// defaultValue={type === "date" && "2023-07-26" : undefined}
|
||||
// value={"2023-07-26"}
|
||||
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Box, Button, Divider, Heading, Spinner } from "@chakra-ui/react";
|
||||
import { Box, Button, Divider, FormHelperText, Heading, Spinner, Text } from "@chakra-ui/react";
|
||||
import React from "react";
|
||||
import FormField from "./FormField";
|
||||
import { OPACITY_ON_LOAD } from "../Layout/animations";
|
||||
@@ -83,7 +83,7 @@ const FormInputMain = ({
|
||||
handleImageChange={handleImageChange}
|
||||
removeImage={removeImage}
|
||||
width={width}
|
||||
value={value}
|
||||
value={type === "date" ? null :value}
|
||||
handleInputChange={handleInputChange}
|
||||
align={align}
|
||||
maxLength={maxLength}
|
||||
@@ -91,6 +91,7 @@ const FormInputMain = ({
|
||||
)
|
||||
)}
|
||||
</Box>
|
||||
|
||||
{index < Object.entries(groupedFields).length - 1 && <Divider />}
|
||||
</Box>
|
||||
))}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Box, Button, Divider, FormLabel, Heading, Image, Input, InputGroup, InputRightAddon, Table, Tbody, Td, Th, Thead, Tr } from "@chakra-ui/react";
|
||||
import { Box, Button, Divider, FormHelperText, FormLabel, Heading, Image, Input, InputGroup, InputRightAddon, Table, Tbody, Td, Th, Thead, Tr } from "@chakra-ui/react";
|
||||
import React from "react";
|
||||
|
||||
const FormInputView = ({
|
||||
@@ -120,9 +120,11 @@ const FormInputView = ({
|
||||
>
|
||||
{type === "number" ? value : value}
|
||||
</FormLabel>
|
||||
|
||||
</Box>
|
||||
)
|
||||
)}
|
||||
|
||||
</Box>
|
||||
{/* </Box> */}
|
||||
{index <
|
||||
@@ -130,6 +132,7 @@ const FormInputView = ({
|
||||
<Divider />
|
||||
)}
|
||||
</Box>
|
||||
|
||||
)
|
||||
)}
|
||||
{children}
|
||||
|
||||
@@ -73,6 +73,7 @@ const IOArtifactsAdd = ({ isOpen, onClose, firstField }) => {
|
||||
console.log(error);
|
||||
|
||||
}
|
||||
reset()
|
||||
|
||||
};
|
||||
|
||||
@@ -140,7 +141,7 @@ const IOArtifactsAdd = ({ isOpen, onClose, firstField }) => {
|
||||
<DrawerFooter>
|
||||
<Button
|
||||
variant="outline"
|
||||
colorScheme={"green"}
|
||||
colorScheme={"forestGreen"}
|
||||
rounded={"sm"}
|
||||
size={"sm"}
|
||||
mr={3}
|
||||
@@ -150,7 +151,7 @@ const IOArtifactsAdd = ({ isOpen, onClose, firstField }) => {
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
colorScheme={"green"}
|
||||
colorScheme={"forestGreen"}
|
||||
rounded={"sm"}
|
||||
size={"sm"}
|
||||
onClick={() => setAlert(true)}
|
||||
|
||||
@@ -295,6 +295,7 @@ const IODetails = ({ enableNextTab, index, data }) => {
|
||||
isRequired: true,
|
||||
section: " ",
|
||||
width: "32.3%",
|
||||
helperText: IObyID && `Current closing date is : ${formatDate(IObyID?.data?.closingDate)}`
|
||||
},
|
||||
{
|
||||
label: "Holding Period",
|
||||
|
||||
@@ -74,6 +74,7 @@ const IOArtifactsAdd = ({ isOpen, onClose, firstField }) => {
|
||||
setFile(null)
|
||||
setIsLoading(false)
|
||||
setAlert(false);
|
||||
setPreview(null)
|
||||
onClose();
|
||||
}
|
||||
|
||||
@@ -105,6 +106,10 @@ const IOArtifactsAdd = ({ isOpen, onClose, firstField }) => {
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
setFile(null)
|
||||
setPreview(null)
|
||||
reset()
|
||||
onClose()
|
||||
|
||||
}
|
||||
|
||||
@@ -115,7 +120,7 @@ const IOArtifactsAdd = ({ isOpen, onClose, firstField }) => {
|
||||
isOpen={isOpen}
|
||||
placement="right"
|
||||
initialFocusRef={firstField}
|
||||
onClose={onClose}
|
||||
onClose={handleClose}
|
||||
>
|
||||
<DrawerOverlay />
|
||||
<DrawerContent>
|
||||
|
||||
@@ -158,16 +158,16 @@ const ViewIOdataHeader = () => {
|
||||
</Text>
|
||||
</Box> */}
|
||||
|
||||
<Box display={"flex"} flexDirection={"column"} gap={2}>
|
||||
{/* <Box display={"flex"} flexDirection={"column"} gap={2}>
|
||||
<Text as={"span"} fontSize={"xs"} color={"gray.500"} fontWeight={"500"}>
|
||||
IO ID
|
||||
</Text>
|
||||
<Text as={"span"} fontSize={"sm"} fontWeight={"500"}>
|
||||
{IODetails?.io_id ? IODetails?.io_id : "---"}
|
||||
</Text>
|
||||
</Box>
|
||||
</Box> */}
|
||||
|
||||
<Box display={"flex"} flexDirection={"column"} gap={2}>
|
||||
<Box display={"flex"} w={"auto"} flexDirection={"column"} gap={2}>
|
||||
<Text as={"span"} fontSize={"xs"} color={"gray.500"} fontWeight={"500"}>
|
||||
IO Name
|
||||
</Text>
|
||||
@@ -178,7 +178,7 @@ const ViewIOdataHeader = () => {
|
||||
</Text>
|
||||
</Box>
|
||||
|
||||
<Box display={"flex"} flexDirection={"column"} gap={2}>
|
||||
<Box display={"flex"} flexDirection={"column"} gap={2}>
|
||||
<Text as={"span"} fontSize={"xs"} color={"gray.500"} fontWeight={"500"}>
|
||||
Sponsorer Name
|
||||
</Text>
|
||||
|
||||
@@ -13,7 +13,14 @@ import { debounce } from "./AddSponser";
|
||||
import { TABLE_PAGINATION } from "../../../Constants/Paginations";
|
||||
import {useDeleteSponserMutation,useGetSponserMasterQuery,useToggleStatusMutation,} from "../../../Services/sponser.service";
|
||||
|
||||
export const formatDate = (date) => new Date(date).toLocaleDateString(); // Simple date formatter
|
||||
export const formatDate = (date) => {
|
||||
const d = new Date(date);
|
||||
const year = d.getFullYear();
|
||||
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}`;
|
||||
};
|
||||
|
||||
const Sponser = () => {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user