окошко спасиб за заявку
This commit is contained in:
parent
6945cf857f
commit
1d1fb02ca7
@ -8,6 +8,7 @@ import { sendContactFormRequest } from "@/api/tariff"
|
|||||||
import { TimePicker } from "@mui/x-date-pickers"
|
import { TimePicker } from "@mui/x-date-pickers"
|
||||||
import moment, { Moment } from "moment"
|
import moment, { Moment } from "moment"
|
||||||
import { enqueueSnackbar } from "notistack"
|
import { enqueueSnackbar } from "notistack"
|
||||||
|
import { useState } from "react"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
open: boolean
|
open: boolean
|
||||||
@ -88,8 +89,60 @@ export const ModalRequestCreate = ({
|
|||||||
}: Props) => {
|
}: Props) => {
|
||||||
const theme = useTheme()
|
const theme = useTheme()
|
||||||
const isMobile = useMediaQuery(theme.breakpoints.down(650));
|
const isMobile = useMediaQuery(theme.breakpoints.down(650));
|
||||||
|
const [isSending, setIsSending] = useState(false)
|
||||||
|
|
||||||
|
if (isSending) return (
|
||||||
|
<Modal
|
||||||
|
open={open}
|
||||||
|
onClose={onClose}
|
||||||
|
>
|
||||||
|
<Box sx={{
|
||||||
|
position: 'absolute' as 'absolute',
|
||||||
|
top: '50%',
|
||||||
|
left: '50%',
|
||||||
|
transform: 'translate(-50%, -50%)',
|
||||||
|
bgcolor: 'background.paper',
|
||||||
|
boxShadow: 24,
|
||||||
|
width: isMobile ? "343px" : "418px",
|
||||||
|
borderRadius: "10px",
|
||||||
|
p: "50px"
|
||||||
|
}}>
|
||||||
|
<Typography
|
||||||
|
sx={{
|
||||||
|
fontSize: "24px",
|
||||||
|
fontWeight: 500,
|
||||||
|
lineHeight: "28.44px",
|
||||||
|
textAlign: "center"
|
||||||
|
}}
|
||||||
|
>Спасибо за заявку!</Typography>
|
||||||
|
<Typography
|
||||||
|
sx={{
|
||||||
|
fontSize: "18px",
|
||||||
|
lineHeight: "21.33px",
|
||||||
|
color: "#4D4D4D",
|
||||||
|
m: "5px 0 30px 0"
|
||||||
|
|
||||||
|
}}
|
||||||
|
>С вами свяжутся в течение 24 часов</Typography>
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
fullWidth
|
||||||
|
onClick={onClose}
|
||||||
|
sx={{
|
||||||
|
py: "12px",
|
||||||
|
"&:hover": {
|
||||||
|
backgroundColor: "#581CA7",
|
||||||
|
},
|
||||||
|
"&:active": {
|
||||||
|
color: "white",
|
||||||
|
backgroundColor: "black",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>Ок</Button>
|
||||||
|
|
||||||
|
</Box>
|
||||||
|
</Modal>
|
||||||
|
)
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
open={open}
|
open={open}
|
||||||
@ -159,11 +212,11 @@ export const ModalRequestCreate = ({
|
|||||||
console.log(resp)
|
console.log(resp)
|
||||||
if (resp[0]?.status === 200) {
|
if (resp[0]?.status === 200) {
|
||||||
enqueueSnackbar("Запрос успешно отправлен")
|
enqueueSnackbar("Запрос успешно отправлен")
|
||||||
onClose()
|
setIsSending(true)
|
||||||
}
|
}
|
||||||
if (resp[1]) {
|
if (resp[1]) {
|
||||||
enqueueSnackbar(resp[1])
|
enqueueSnackbar(resp[1])
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{({ values, isSubmitting, setFieldValue }) => (<>
|
{({ values, isSubmitting, setFieldValue }) => (<>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user