Skip to content

Commit

Permalink
Issue #0000 feat: Modal bug fixes 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Arif-tekdi-technologies committed Nov 21, 2024
1 parent c9a7466 commit 5795910
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
10 changes: 8 additions & 2 deletions src/components/AddBlockModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export const AddBlockModal: React.FC<AddBlockModalProps> = ({

const districtCodeArray = districts.map((item: any) => item.value);
setDistrictCodeArr(districtCodeArray);

} catch (error) {
console.error("Error fetching districts", error);
}
Expand Down Expand Up @@ -296,7 +295,14 @@ export const AddBlockModal: React.FC<AddBlockModalProps> = ({
: t("COMMON.ADD_BLOCK");

return (
<Dialog open={open} onClose={onClose}>
<Dialog
open={open}
onClose={(event, reason) => {
if (reason !== "backdropClick") {
onClose();
}
}}
>
<DialogTitle sx={{ fontSize: "14px" }}>{dialogTitle}</DialogTitle>
<Divider />
<DialogContent>
Expand Down
9 changes: 8 additions & 1 deletion src/components/AddDistrictModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,14 @@ const AddDistrictModal: React.FC<AddDistrictBlockModalProps> = ({
: t("COMMON.ADD_DISTRICT");

return (
<Dialog open={open} onClose={onClose}>
<Dialog
open={open}
onClose={(event, reason) => {
if (reason !== "backdropClick") {
onClose();
}
}}
>
<DialogTitle sx={{ fontSize: "14px" }}>{dialogTitle}</DialogTitle>
<Divider />
<DialogContent>
Expand Down
11 changes: 9 additions & 2 deletions src/components/AddStateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const AddStateModal: React.FC<AddStateModalProps> = ({
newErrors.name = t("COMMON.STATE_NAME_REQUIRED");
} else if (!isValidName(formData.name.trim())) {
newErrors.name = t("COMMON.INVALID_TEXT");
}
}

if (!formData.value) {
newErrors.value = t("COMMON.CODE_REQUIRED");
Expand All @@ -113,7 +113,14 @@ export const AddStateModal: React.FC<AddStateModalProps> = ({
};

return (
<Dialog open={open} onClose={onClose}>
<Dialog
open={open}
onClose={(event, reason) => {
if (reason !== "backdropClick") {
onClose();
}
}}
>
<DialogTitle sx={{ fontSize: "14px" }}>
{stateId ? t("COMMON.UPDATE_STATE") : t("COMMON.ADD_STATE")}
</DialogTitle>
Expand Down
11 changes: 10 additions & 1 deletion src/components/FileUploadDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,16 @@ const FileUploadDialog: React.FC<FileUploadDialogProps> = ({

return (
<Box>
<Dialog open={open} onClose={onClose} maxWidth="lg" fullWidth>
<Dialog
open={open}
onClose={(event, reason) => {
if (reason !== "backdropClick") {
onClose();
}
}}
maxWidth="lg"
fullWidth
>
<Box sx={{ display: "flex", flexDirection: "column" }}>
<Box
sx={{
Expand Down

0 comments on commit 5795910

Please sign in to comment.