feat: Sight Page update

This commit is contained in:
2025-06-01 23:18:21 +03:00
parent 87386c6a73
commit a8777a974a
26 changed files with 3460 additions and 727 deletions

View File

@ -6,8 +6,9 @@ import {
MainPage,
SightPage,
} from "@pages";
import { authStore, editSightStore, sightsStore } from "@shared";
import { authStore, createSightStore, editSightStore } from "@shared";
import { Layout } from "@widgets";
import { runInAction } from "mobx";
import { useEffect } from "react";
import { Navigate, Outlet, Route, Routes, useLocation } from "react-router-dom";
@ -34,10 +35,15 @@ const ProtectedRoute = ({ children }: { children: React.ReactNode }) => {
export const Router = () => {
const pathname = useLocation();
useEffect(() => {
editSightStore.clearSightInfo();
sightsStore.clearCreateSight();
createSightStore.clearCreateSight();
runInAction(() => {
editSightStore.hasLoadedCommon = false;
});
}, [pathname]);
return (
<Routes>
<Route