добавлен контейнер Заявка оформлена
This commit is contained in:
@@ -11,7 +11,9 @@ export const PinkButton:React.FC<TProps> = React.memo((props) => {
|
|||||||
return <button
|
return <button
|
||||||
style={{width: props.width ? props.width : ''}}
|
style={{width: props.width ? props.width : ''}}
|
||||||
className="main-part-text-button"
|
className="main-part-text-button"
|
||||||
onClick={() => props?.onClick()}
|
onClick={() => {
|
||||||
|
return props?.onClick ? props.onClick() : null;
|
||||||
|
}}
|
||||||
type={props.type ? props.type : 'button'}
|
type={props.type ? props.type : 'button'}
|
||||||
>
|
>
|
||||||
{props.textButton}
|
{props.textButton}
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import { StyledOptions } from "@emotion/styled";
|
|||||||
import { MUIStyledCommonProps } from "@mui/system";
|
import { MUIStyledCommonProps } from "@mui/system";
|
||||||
|
|
||||||
type TProps = {
|
type TProps = {
|
||||||
// dateInfo: string
|
dateInfo: string
|
||||||
onSubmit: (data: FormData) => void
|
onSubmit: (data: FormData, date: string) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
type FormData = {
|
type FormData = {
|
||||||
@@ -20,12 +20,7 @@ type FormData = {
|
|||||||
export const Form:React.FC<TProps> = React.memo((props) => {
|
export const Form:React.FC<TProps> = React.memo((props) => {
|
||||||
const {control, handleSubmit} = useForm<FormData>();
|
const {control, handleSubmit} = useForm<FormData>();
|
||||||
const [isError, setIsError] = useState(false);
|
const [isError, setIsError] = useState(false);
|
||||||
let inputPr: InputProps = {
|
|
||||||
|
|
||||||
}
|
|
||||||
let a: StyledOptions<TextFieldProps> = {
|
|
||||||
|
|
||||||
}
|
|
||||||
const CustomizedTextField = styled(TextField)`
|
const CustomizedTextField = styled(TextField)`
|
||||||
background: #322948;
|
background: #322948;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
@@ -75,7 +70,7 @@ export const Form:React.FC<TProps> = React.memo((props) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log(data)
|
console.log(data)
|
||||||
props.onSubmit(data)
|
props.onSubmit(data, props.dateInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
return <div className="request-form-container">
|
return <div className="request-form-container">
|
||||||
@@ -140,7 +135,6 @@ export const Form:React.FC<TProps> = React.memo((props) => {
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* <input className="request-form-submit-button" type="submit" value={'Записаться на просмотр'}/> */}
|
|
||||||
<PinkButton
|
<PinkButton
|
||||||
type="submit"
|
type="submit"
|
||||||
textButton={'Записаться на просмотр'}
|
textButton={'Записаться на просмотр'}
|
||||||
|
|||||||
@@ -64,6 +64,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.main-part-text-container {
|
.main-part-text-container {
|
||||||
|
z-index: 1;
|
||||||
width: 800px;
|
width: 800px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -20,14 +20,14 @@ export const MainPart: React.FC = React.memo(() => {
|
|||||||
const changeContent = useRef(0);
|
const changeContent = useRef(0);
|
||||||
const [showBackground, setShowBackground] = useState<boolean>(false);
|
const [showBackground, setShowBackground] = useState<boolean>(false);
|
||||||
const [planContent, setPlaneContent] = useState<JSX.Element>();
|
const [planContent, setPlaneContent] = useState<JSX.Element>();
|
||||||
const [currentContent, setCurrentContent] = useState<JSX.Element>(
|
const defaultCurrentContent =
|
||||||
<ContentContainer
|
<ContentContainer
|
||||||
titleText="Удаленная демонстрация жилого комплекса"
|
titleText="Удаленная демонстрация жилого комплекса"
|
||||||
descriptText="Основанная на стриминге технология удаленной демонстрации позволяет познакомиться с жилым комплексом, не посещая офис продаж."
|
descriptText="Основанная на стриминге технология удаленной демонстрации позволяет познакомиться с жилым комплексом, не посещая офис продаж."
|
||||||
onClickButton={() => onClickStartDemo()}
|
onClickButton={() => onClickStartDemo()}
|
||||||
textButton='Начать демонстрацию'
|
textButton='Начать демонстрацию'
|
||||||
/>
|
/>
|
||||||
);
|
const [currentContent, setCurrentContent] = useState<JSX.Element>(defaultCurrentContent);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// changeContent.current += 1;
|
// changeContent.current += 1;
|
||||||
@@ -100,15 +100,34 @@ export const MainPart: React.FC = React.memo(() => {
|
|||||||
<PlanContentContainer
|
<PlanContentContainer
|
||||||
title="Оформление"
|
title="Оформление"
|
||||||
date={dateTime}
|
date={dateTime}
|
||||||
content={<Form onSubmit={(data) => onSubmit(data)} />}
|
content={
|
||||||
|
<Form
|
||||||
|
onSubmit={(data, date) => onSubmit(data, date)}
|
||||||
|
dateInfo={dateTime}
|
||||||
|
/>
|
||||||
|
}
|
||||||
isLegend={false}
|
isLegend={false}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
console.log(dateTime)
|
console.log(dateTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSubmit(data: FormData) {
|
function onSubmit(data: FormData, date: string) {
|
||||||
|
setPlaneContent(null);
|
||||||
|
setCurrentContent(
|
||||||
|
<ContentContainer
|
||||||
|
titleText="Просмотр запланирован"
|
||||||
|
descriptText="Дополнительная информация будет отправлена на указанный почтовый адрес или номер телефона."
|
||||||
|
textButton="На главную"
|
||||||
|
onClickButton={() => toMain()}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
console.log(data, date)
|
||||||
|
}
|
||||||
|
|
||||||
|
function toMain() {
|
||||||
|
setCurrentContent(defaultCurrentContent);
|
||||||
|
disableBackground();
|
||||||
}
|
}
|
||||||
|
|
||||||
function enableBackground() {
|
function enableBackground() {
|
||||||
|
|||||||
Reference in New Issue
Block a user