Files
pixelstreamingv2/src/components/pages/Plan/PlanComponent.tsx
T
2023-02-22 09:18:03 +05:00

89 lines
2.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import "./PlanComponent.css";
import logo from "./Aivaz.svg";
import { useState } from "react";
import * as moment from "moment";
import "moment/locale/ru";
import { motion, AnimatePresence } from "framer-motion";
import { CalendarComponent } from "./CalendarComponent/CalendarComponent";
import { TimepickerComponent } from "./TimepickerComponent/TimepickerComponent";
import { Form } from "./Form/Form";
import { Finish } from "./Finish/Finish";
import { useAppSelector } from "hooks/redux";
import { popupAnimation } from "utils/animationProps";
export const PlanComponent: React.FC<any> = () => {
const { isDone, isCalendar, isTimepicker, isForm, time } = useAppSelector(
(state) => state.planReducer
);
return (
<div className="content-container-plan">
<img alt="logo" src={logo} className="plan-logo"></img>
<div className="calendar-position">
<AnimatePresence mode="wait">
{isCalendar && (
<motion.div
style={{ height: "560px" }}
key={1}
variants={popupAnimation}
initial={"hidden"}
animate={"show"}
exit={"hidden"}
>
<CalendarComponent time={time}></CalendarComponent>
</motion.div>
)}
{isTimepicker && (
<motion.div
style={{ height: "560px" }}
key={2}
variants={popupAnimation}
initial={"hidden"}
animate={"show"}
exit={"hidden"}
>
<TimepickerComponent time={time}></TimepickerComponent>
</motion.div>
)}
{isForm && (
<motion.div
style={{ height: "560px" }}
key={3}
variants={popupAnimation}
initial={"hidden"}
animate={"show"}
exit={"hidden"}
>
<Form time={time}></Form>
</motion.div>
)}
{isDone && (
<motion.div
style={{ height: "560px" }}
key={4}
variants={popupAnimation}
initial={"hidden"}
animate={"show"}
exit={"hidden"}
>
<Finish></Finish>
</motion.div>
)}
</AnimatePresence>
{!isDone && (
<>
<div className="line line-calendar"></div>
<button className="button button-type-small">
На сайт жилого комплекса
</button>
</>
)}
</div>
</div>
);
};