feat: demo page realisation
This commit is contained in:
@@ -33,11 +33,18 @@ import {
|
||||
StationEditPage,
|
||||
RouteCreatePage,
|
||||
RoutePreview,
|
||||
DemoPage,
|
||||
RouteEditPage,
|
||||
ArticlePreviewPage,
|
||||
CountryAddPage,
|
||||
} from "@pages";
|
||||
import { authStore, createSightStore, editSightStore, ROUTE_REQUIRED_RESOURCES } from "@shared";
|
||||
import {
|
||||
authStore,
|
||||
createSightStore,
|
||||
editSightStore,
|
||||
languageStore,
|
||||
ROUTE_REQUIRED_RESOURCES,
|
||||
} from "@shared";
|
||||
import { Layout } from "@widgets";
|
||||
import { runInAction } from "mobx";
|
||||
import React, { useEffect } from "react";
|
||||
@@ -102,6 +109,14 @@ const ClearStoresWrapper: React.FC<{ children: React.ReactNode }> = ({
|
||||
runInAction(() => {
|
||||
editSightStore.hasLoadedCommon = false;
|
||||
});
|
||||
|
||||
if (
|
||||
location.pathname.includes("create") ||
|
||||
location.pathname.includes("edit") ||
|
||||
location.pathname.includes("add")
|
||||
) {
|
||||
languageStore.setLanguage("ru");
|
||||
}
|
||||
}, [location]);
|
||||
|
||||
return <>{children}</>;
|
||||
@@ -120,6 +135,10 @@ const router = createBrowserRouter([
|
||||
path: "route-preview/:id",
|
||||
element: <RoutePreview />,
|
||||
},
|
||||
{
|
||||
path: "demo/:id",
|
||||
element: <DemoPage />,
|
||||
},
|
||||
{
|
||||
path: "/",
|
||||
element: (
|
||||
|
||||
Reference in New Issue
Block a user