Compare commits
2 Commits
efddfe6d7a
...
a108dcdb17
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a108dcdb17 | ||
|
|
41a1bde62b |
@@ -3,6 +3,7 @@ import {
|
||||
Box,
|
||||
Button,
|
||||
FormControl,
|
||||
FormHelperText,
|
||||
FormLabel,
|
||||
Input,
|
||||
Modal,
|
||||
@@ -36,12 +37,12 @@ import {
|
||||
|
||||
const FILE_TYPES = ["image/jpeg", "image/png", "image/gif"];
|
||||
|
||||
// export const conformModalSchema = yup.object().shape({
|
||||
// adminComment: yup.string().notRequired(),
|
||||
// });
|
||||
|
||||
export const conformModalSchema = yup.object().shape({
|
||||
adminComment: yup
|
||||
.string()
|
||||
.min(2, "Comment contain at least 2 character")
|
||||
.max(150, "Comment contain at less then 150 character")
|
||||
.notRequired(),
|
||||
adminComment: yup.string().notRequired(),
|
||||
});
|
||||
|
||||
const DeletionRequestApprove = ({
|
||||
@@ -66,6 +67,7 @@ const DeletionRequestApprove = ({
|
||||
const {
|
||||
register,
|
||||
reset,
|
||||
watch,
|
||||
handleSubmit,
|
||||
formState: { errors },
|
||||
} = useForm({
|
||||
@@ -184,6 +186,10 @@ const DeletionRequestApprove = ({
|
||||
{errors.adminComment.message}
|
||||
</Text>
|
||||
)}
|
||||
<FormHelperText fontSize="xs" color="gray.500">
|
||||
<Text as={'span'} me={2}> Maximum length should be 200 characters. You have entered</Text>
|
||||
{watch("adminComment")?.length || 0} characters.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
@@ -193,9 +199,10 @@ const DeletionRequestApprove = ({
|
||||
type="submit"
|
||||
size={"sm"}
|
||||
rounded={"sm"}
|
||||
variant={"ghost"}
|
||||
onClick={() => setIsReject(true)}
|
||||
variant={'ghost'}
|
||||
onClick={()=> setIsReject(true)}
|
||||
isLoading={isBtnLoadingReject}
|
||||
fontWeight={500}
|
||||
>
|
||||
Reject
|
||||
</Button>
|
||||
|
||||
@@ -140,7 +140,7 @@ const RequestApproveModal = ({ isOpen, onClose, firstField ,id}) => {
|
||||
rounded={"md"}
|
||||
resize={"none"}
|
||||
maxLength={200}
|
||||
/>
|
||||
/>
|
||||
{errors.checkerComment && (
|
||||
<Text fontSize="xs" color="red">
|
||||
{errors.checkerComment.message}
|
||||
|
||||
Reference in New Issue
Block a user