diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 29019b5..74a1411 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -2,10 +2,16 @@ import { FullScreen, useFullScreenHandle } from "react-full-screen"; import { useEffect } from "react"; import { Outlet } from "react-router-dom"; import useStore from "../store/store"; +import { useParams } from "react-router-dom"; const Layout = () => { const { loader, setOnFullscreen, modal, hintModal } = useStore(); const onFullscreenHandle = useFullScreenHandle(); + const { lang } = useParams(); + + useEffect(() => { + console.log("lang", lang); + }, []); useEffect(() => { setOnFullscreen(onFullscreenHandle); diff --git a/src/main.tsx b/src/main.tsx index a4aeb42..50a4c5d 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -7,15 +7,15 @@ import Layout from "./components/Layout"; const router = createBrowserRouter([ { - path: "/", + path: "/:lang/", element: , children: [ { - path: "ar/:villaTitle", + path: "villa/:villaTitle", element: , }, { - path: "ar/", + index: true, element: , }, ],