fix
This commit is contained in:
1 parent
0c927a57f6
commit
b8422f5472
8 files changed
+560
-14
No files matched your search
@@ -7,6 +7,7 @@ import { yupResolver } from "@hookform/resolvers/yup";
|
||||
import styles from "./PriceLisForm.module.css";
|
||||
import Button from "../Button/Button";
|
||||
import { client } from "../../api/client";
|
||||
import { useState } from "react";
|
||||
|
||||
// ✅ Схема валидации
|
||||
const schema = yup.object().shape({
|
||||
@@ -27,6 +28,7 @@ interface FormData {
|
||||
}
|
||||
|
||||
const PriceLisForm: React.FC<Props> = ({ open, onClose }) => {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
console.log('ModalRequestForm render, open:', open);
|
||||
const {
|
||||
register,
|
||||
@@ -85,6 +87,7 @@ const PriceLisForm: React.FC<Props> = ({ open, onClose }) => {
|
||||
|
||||
reset();
|
||||
onClose();
|
||||
setIsOpen(true);
|
||||
} catch (error) {
|
||||
Modal.error({
|
||||
title: "Ошибка",
|
||||
@@ -95,6 +98,25 @@ const PriceLisForm: React.FC<Props> = ({ open, onClose }) => {
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
open={isOpen}
|
||||
footer={null}
|
||||
onCancel={() => setIsOpen(false)}
|
||||
centered
|
||||
width={500}
|
||||
>
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 40 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ duration: 0.35 }}
|
||||
className={styles.modalBox}
|
||||
>
|
||||
<p className={styles.title}>
|
||||
Спасибо за обращение! Мы свяжемся с Вами в ближайшее время. Удачного дня!
|
||||
</p>
|
||||
</motion.div>
|
||||
</Modal>
|
||||
<Modal
|
||||
open={open}
|
||||
footer={null}
|
||||
@@ -154,6 +176,7 @@ const PriceLisForm: React.FC<Props> = ({ open, onClose }) => {
|
||||
</form>
|
||||
</motion.div>
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user