diff --git a/src/components/header/Auth/AuthDesktop.tsx b/src/components/header/Auth/AuthDesktop.tsx index c9ade81..edc485f 100644 --- a/src/components/header/Auth/AuthDesktop.tsx +++ b/src/components/header/Auth/AuthDesktop.tsx @@ -1,7 +1,7 @@ import useModal from "../../../store/useModal"; import Button from "../../Button"; import AuthIcon from "../../icons/AuthIcon"; -import LoginModal from "../../modals/LoginModal"; +import LoginModal from "../../modals/auth/LoginModal"; interface AuthProps { isAuth: boolean; diff --git a/src/components/modals/auth/ContinueLoginModal.tsx b/src/components/modals/auth/ContinueLoginModal.tsx new file mode 100644 index 0000000..0c2f6ad --- /dev/null +++ b/src/components/modals/auth/ContinueLoginModal.tsx @@ -0,0 +1,94 @@ +import { createRef, useLayoutEffect, useState, RefObject } from "react"; +import useModal from "../../../store/useModal"; +import Button from "../../Button"; +import CrossIcon from "../../icons/CrossIcon"; +import RegistrationModal from "./RegistrationModal"; + +const ContinueLoginModal = () => { + const { setModal } = useModal(); + const [codeRefs, setCodeRefs] = useState[]>([]); + + const codeLength = 6; + + useLayoutEffect(() => { + const refs = Array.from({ length: codeLength }).map(() => + createRef() + ); + setCodeRefs(refs); + }, []); + + const handleOnCloseClick = () => { + setModal(null); + }; + + const handleOnCancelClick = () => { + setModal(); + }; + + const handleOnCodeInput = ( + refIndex: number, + e: React.ChangeEvent + ) => { + const char = e.currentTarget.value; + const isNotEmpty = char !== ""; + const isCountOne = char.length === 1; + if (refIndex < codeLength && isNotEmpty && isCountOne) { + codeRefs[refIndex + 1].current?.focus(); + } + }; + + return ( +
+
+
+

+ Enter the code +

+ +
+
+ We`ve sent the code to

number

+
+
+ {codeRefs.map((ref, index) => ( +
+ handleOnCodeInput(index, e)} + ref={ref} + type="number" + className="input_number outline-transparent aspect-square w-full text-center" + /> +
+ ))} +

+ Resend code +

+ +
+
+

+ By clicking on the button, you accept the{" "} + + privacy policy + {" "} + and consent to the processing of personal data. +

+
+
+
+ ); +}; + +export default ContinueLoginModal; diff --git a/src/components/modals/auth/ContinueRegistrationModal.tsx b/src/components/modals/auth/ContinueRegistrationModal.tsx new file mode 100644 index 0000000..e171c7c --- /dev/null +++ b/src/components/modals/auth/ContinueRegistrationModal.tsx @@ -0,0 +1,94 @@ +import { createRef, useLayoutEffect, useState, RefObject } from "react"; +import useModal from "../../../store/useModal"; +import Button from "../../Button"; +import CrossIcon from "../../icons/CrossIcon"; +import RegistrationModal from "./RegistrationModal"; + +const ContinueRegistrationModal = () => { + const { setModal } = useModal(); + const [codeRefs, setCodeRefs] = useState[]>([]); + + const codeLength = 6; + + useLayoutEffect(() => { + const refs = Array.from({ length: codeLength }).map(() => + createRef() + ); + setCodeRefs(refs); + }, []); + + const handleOnCloseClick = () => { + setModal(null); + }; + + const handleOnCancelClick = () => { + setModal(); + }; + + const handleOnCodeInput = ( + refIndex: number, + e: React.ChangeEvent + ) => { + const char = e.currentTarget.value; + const isNotEmpty = char !== ""; + const isCountOne = char.length === 1; + if (refIndex < codeLength && isNotEmpty && isCountOne) { + codeRefs[refIndex + 1].current?.focus(); + } + }; + + return ( +
+
+
+

+ Enter the code +

+ +
+
+ We`ve sent the code to

number

+
+
+ {codeRefs.map((ref, index) => ( +
+ handleOnCodeInput(index, e)} + ref={ref} + type="number" + className="input_number outline-transparent aspect-square w-full text-center" + /> +
+ ))} +

+ Resend code +

+ +
+
+

+ By clicking on the button, you accept the{" "} + + privacy policy + {" "} + and consent to the processing of personal data. +

+
+
+
+ ); +}; + +export default ContinueRegistrationModal; diff --git a/src/components/modals/LoginModal.tsx b/src/components/modals/auth/LoginModal.tsx similarity index 55% rename from src/components/modals/LoginModal.tsx rename to src/components/modals/auth/LoginModal.tsx index b4f0bb8..c96b027 100644 --- a/src/components/modals/LoginModal.tsx +++ b/src/components/modals/auth/LoginModal.tsx @@ -1,14 +1,25 @@ -import useModal from "../../store/useModal"; -import Button from "../Button"; -import MasterSelector from "../MasterSelector"; -import CrossIcon from "../icons/CrossIcon"; +import useModal from "../../../store/useModal"; +import Button from "../../Button"; +import MasterSelector from "../../MasterSelector"; +import CrossIcon from "../../icons/CrossIcon"; +import ContinueLoginModal from "./ContinueLoginModal"; +import RegistrationModal from "./RegistrationModal"; const LoginModal = () => { const { setModal } = useModal(); + const handleOnCloseClick = () => { setModal(null); }; + const handleOnCreateAccoutClick = () => { + setModal(); + }; + + const handleOnLoginClick = () => { + setModal(); + }; + return (
@@ -22,11 +33,21 @@ const LoginModal = () => {
+
+
- +
+
+ + + + +
+
+
+ +
+ Already have an account?{" "} +

+ login +

+
+
+

+ By clicking on the button, you accept the and consent to the{" "} + + privacy policy{" "} + {" "} + processing of personal data. +

+
+
+ + ); +}; + +export default RegistrationModal; diff --git a/src/components/multiRangeSlider.css b/src/components/multiRangeSlider.css index 8c9180c..aac1962 100644 --- a/src/components/multiRangeSlider.css +++ b/src/components/multiRangeSlider.css @@ -51,6 +51,7 @@ left: 50%; transform: translate(-50%, 0); } + .range-slider input[type="range"] { -webkit-appearance: none; pointer-events: none; diff --git a/src/components/virtualTour/VirtualTourSidebar.tsx b/src/components/virtualTour/VirtualTourSidebar.tsx index c55bec0..005093c 100644 --- a/src/components/virtualTour/VirtualTourSidebar.tsx +++ b/src/components/virtualTour/VirtualTourSidebar.tsx @@ -1,4 +1,4 @@ -import { useState } from "react"; +import { useEffect, useState } from "react"; import useSphere from "../../store/useSphere"; import { IAppartmentSphere, ISphere } from "../../types/apartmentSphere"; import Button from "../Button"; @@ -7,6 +7,8 @@ import ChevronDownIcon from "../icons/ChevronDownIcon"; import HeartIcon from "../icons/Heart"; import MapVectorIcon from "../icons/MapVectorIcon"; import useCompass from "../../store/useCompass"; +import LeftArrowIcon from "../icons/LeftArrowIcon"; +import InfoIcon from "../icons/InfoIcon"; interface VirtualTourSidebarProps { currentAppartment: null | IAppartmentSphere; @@ -28,35 +30,43 @@ const VirtualTourSidebar = ({ currentAppartment }: VirtualTourSidebarProps) => {
-
-

- Rove Home Marasi Drive{" "} +

+
-
- 234 +
+

+ Rove Home Marasi Drive{" "} +

+
+

+ East Wing +

+
+

+ Floor 11 +

+
+

+ № 213 +

+
-

- 1 bedroom appartment -

-
+
{
-
-
@@ -111,11 +127,11 @@ const VirtualTourSidebar = ({ currentAppartment }: VirtualTourSidebarProps) => { ); })}
-
-
+
+