diff --git a/package.json b/package.json index dd19e6e..728d23d 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "@arcgis/core": "^4.28.10", "@react-spring/web": "^9.7.3", "@use-gesture/react": "^10.3.0", - "gsap": "^3.12.5", "react": "^18.2.0", "react-device-detect": "^2.2.3", "react-dom": "^18.2.0", diff --git a/public/images/map/Villas.emf b/public/images/map/Villas.emf deleted file mode 100644 index 5741b1c..0000000 Binary files a/public/images/map/Villas.emf and /dev/null differ diff --git a/public/images/map/Villas.png b/public/images/map/Villas.png deleted file mode 100644 index d8572b1..0000000 Binary files a/public/images/map/Villas.png and /dev/null differ diff --git a/public/images/map/Villas1.png b/public/images/map/Villas1.png deleted file mode 100644 index 969ae2c..0000000 Binary files a/public/images/map/Villas1.png and /dev/null differ diff --git a/public/images/map/Villas2.png b/public/images/map/Villas2.png new file mode 100644 index 0000000..cb2846f Binary files /dev/null and b/public/images/map/Villas2.png differ diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 7acfd2e..8dec732 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -1,11 +1,10 @@ -import { Outlet } from "react-router-dom"; -import useStore from "../store/store"; import { FullScreen, useFullScreenHandle } from "react-full-screen"; import { useEffect } from "react"; -import ModalContainer from "./ModalContainer"; +import { Outlet } from "react-router-dom"; +import useStore from "../store/store"; const Layout = () => { - const { loader, setOnFullscreen } = useStore(); + const { loader, setOnFullscreen, modal } = useStore(); const onFullscreenHandle = useFullScreenHandle(); useEffect(() => { @@ -14,10 +13,9 @@ const Layout = () => { return ( - {/* {modal} */} + {modal} {loader} - ); }; diff --git a/src/components/LoaderModal.tsx b/src/components/LoaderModal.tsx index 3d691a2..19b3884 100644 --- a/src/components/LoaderModal.tsx +++ b/src/components/LoaderModal.tsx @@ -26,7 +26,7 @@ const LoaderModal = ({ isSimleLoader = false }: LoaderModalProps) => { }, []); return ( -
+
{!isSimleLoader ? (
diff --git a/src/components/Map/MapMediaLayer.tsx b/src/components/Map/MapMediaLayer.tsx index d751928..293a92b 100644 --- a/src/components/Map/MapMediaLayer.tsx +++ b/src/components/Map/MapMediaLayer.tsx @@ -34,7 +34,7 @@ export const MapMediaLayer = ({ useEffect(() => { const allVillasImage = new ImageElement({ - image: "/images/map/Villas1.png", + image: "/images/map/Villas2.png", georeference: new ExtentAndRotationGeoreference({ extent: extent, }), diff --git a/src/components/Map/MapView.tsx b/src/components/Map/MapView.tsx index df21265..7e0f855 100644 --- a/src/components/Map/MapView.tsx +++ b/src/components/Map/MapView.tsx @@ -94,18 +94,12 @@ type MapViewComponentProps = { export const MapViewComponent = (props: MapViewComponentProps) => { const { children, className } = props; - const { selectedOnMapVilla, setLoader, setModal, loader } = useStore(); + const { selectedOnMapVilla, setLoader, setModal } = useStore(); const [isLoading, setIsLoading] = useState(true); const [view, setView] = useState<__esri.MapView | undefined>(); const mapRef = useRef(null); - useEffect(() => { - // setLoader(); - console.log("isLoading", isLoading); - console.log("loader", loader); - }); - useEffect(() => { if (isLoading) { setLoader(); diff --git a/src/components/ModalContainer.tsx b/src/components/ModalContainer.tsx deleted file mode 100644 index 8547b54..0000000 --- a/src/components/ModalContainer.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { useEffect } from "react"; -import useStore from "../store/store"; - -function ModalContainer() { - const { modal, modalAnimation, setModal } = useStore(); - - useEffect(() => { - if (modalAnimation !== 1) return; - const timeout = setTimeout(() => { - setModal(null); - }, 300); - - return clearTimeout(timeout); - }, [modalAnimation]); - - if (modal) { - return ( -
- {modal} -
- ); - } -} - -export default ModalContainer; diff --git a/src/components/desktop/Appartment/ButtonPanel.tsx b/src/components/desktop/Appartment/ButtonPanel.tsx index f4ec2ed..ab1c274 100644 --- a/src/components/desktop/Appartment/ButtonPanel.tsx +++ b/src/components/desktop/Appartment/ButtonPanel.tsx @@ -11,6 +11,7 @@ import ControlHelpModal from "./ControlHelpModal/ControlHelpModal"; import LayoutModal from "./LayoutModal"; import ImagesModal from "./ImagesModal"; import PedestrianIcon from "../../../icons/Pedestrianicon"; +import ModalAnimationContainer from "./ModalAnimationContainer"; type ButtonPanelProps = { handleFullscreen: FullScreenHandle | null; @@ -38,12 +39,20 @@ const ButtonPanel = ({ handleFullscreen }: ButtonPanelProps) => { const handleOnLayoutClick = () => { setModalAnimation(0); - setModal(); + setModal( + + + + ); }; const handleOnImagesClick = () => { setModalAnimation(0); - setModal(); + setModal( + + + + ); }; return ( diff --git a/src/components/desktop/Appartment/ModalAnimationContainer.tsx b/src/components/desktop/Appartment/ModalAnimationContainer.tsx new file mode 100644 index 0000000..6491172 --- /dev/null +++ b/src/components/desktop/Appartment/ModalAnimationContainer.tsx @@ -0,0 +1,34 @@ +import { useEffect } from "react"; +import useStore from "../../../store/store"; + +type ModalContainerProps = { + children: React.ReactNode; +}; + +function ModalAnimationContainer({ children }: ModalContainerProps) { + const { modalAnimation, setModal } = useStore(); + + useEffect(() => { + if (modalAnimation !== 1) return; + const timeout = setTimeout(() => { + setModal(null); + }, 300); + + return clearTimeout(timeout); + }, [modalAnimation]); + + return ( +
+ {children} +
+ ); +} + +export default ModalAnimationContainer; diff --git a/src/components/desktop/Main/HouseList.tsx b/src/components/desktop/Main/HouseList.tsx index 3c093c7..4f5ed7a 100644 --- a/src/components/desktop/Main/HouseList.tsx +++ b/src/components/desktop/Main/HouseList.tsx @@ -1,22 +1,25 @@ import HouseItem from "./HouseItem"; import { VILLAS } from "../../../consts/villas"; + const enableVillas = ["a1t", "a1m", "b2t", "b2m"]; const HouseList = () => { return ( -
-
- {VILLAS.map((villa) => { - return ( - - ); - })} + <> +
+
+ {VILLAS.map((villa) => { + return ( + + ); + })} +
-
+ ); }; diff --git a/src/pages/Desktop/DesktopMainPage.tsx b/src/pages/Desktop/DesktopMainPage.tsx index d866860..02f6bbe 100644 --- a/src/pages/Desktop/DesktopMainPage.tsx +++ b/src/pages/Desktop/DesktopMainPage.tsx @@ -1,16 +1,7 @@ -import { useEffect } from "react"; -import LoaderModal from "../../components/LoaderModal"; import MapComponent from "../../components/Map/Map"; import HouseList from "../../components/desktop/Main/HouseList"; -import useStore from "../../store/store"; const DesktopMainPage = () => { - const { setLoader } = useStore(); - - useEffect(() => { - setLoader(); - }, []); - return ( <> diff --git a/yarn.lock b/yarn.lock index eb1bd61..544785d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1223,11 +1223,6 @@ graphemer@^1.4.0: resolved "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz" integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== -gsap@^3.12.5: - version "3.12.5" - resolved "https://registry.yarnpkg.com/gsap/-/gsap-3.12.5.tgz#136c02dad4c673b441bdb1ca00104bfcb4eae7f4" - integrity sha512-srBfnk4n+Oe/ZnMIOXt3gT605BX9x5+rh/prT2F1SsNJsU1XuMiP0E2aptW481OnonOGACZWBqseH5Z7csHxhQ== - has-flag@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz"