модалка редактирования открывается более раза подряд
This commit is contained in:
parent
5b2a0a55dc
commit
1f060fc5e8
@ -45,9 +45,10 @@ const editTariff = ({ tarifIid, tariffName, tariffPrice, privilege }: EditProps)
|
|||||||
};
|
};
|
||||||
interface Props {
|
interface Props {
|
||||||
tariff: Tariff;
|
tariff: Tariff;
|
||||||
|
closeModal: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function EditModal({ tariff = undefined }: Props) {
|
export default function EditModal({ tariff = undefined, closeModal }: Props) {
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const [name, setName] = useState("");
|
const [name, setName] = useState("");
|
||||||
const [price, setPrice] = useState("");
|
const [price, setPrice] = useState("");
|
||||||
@ -61,7 +62,7 @@ export default function EditModal({ tariff = undefined }: Props) {
|
|||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
open={open}
|
open={open}
|
||||||
onClose={() => setOpen(false)}
|
onClose={() => closeModal(undefined)}
|
||||||
aria-labelledby="modal-modal-title"
|
aria-labelledby="modal-modal-title"
|
||||||
aria-describedby="modal-modal-description"
|
aria-describedby="modal-modal-description"
|
||||||
>
|
>
|
||||||
|
@ -145,7 +145,7 @@ export default function TariffsDG({ selectedTariffs, handleSelectionChange }: Pr
|
|||||||
}}
|
}}
|
||||||
selectedTariffs={selectedTariffs}
|
selectedTariffs={selectedTariffs}
|
||||||
/>
|
/>
|
||||||
<EditModal tariff={changingTariff} />
|
<EditModal tariff={changingTariff} closeModal={setChangingTariff} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user