diff --git a/src/pages/CreateSightPage/index.tsx b/src/pages/CreateSightPage/index.tsx
index 416ac69..96cdeea 100644
--- a/src/pages/CreateSightPage/index.tsx
+++ b/src/pages/CreateSightPage/index.tsx
@@ -1,5 +1,10 @@
import { Box, Tab, Tabs } from "@mui/material";
-import { articlesStore, cityStore, languageStore } from "@shared";
+import {
+ articlesStore,
+ cityStore,
+ createSightStore,
+ languageStore,
+} from "@shared";
import {
CreateInformationTab,
CreateLeftTab,
@@ -22,13 +27,15 @@ export const CreateSightPage = observer(() => {
const [value, setValue] = useState(0);
const { getCities } = cityStore;
const { getArticles } = articlesStore;
+ const { needLeaveAgree } = createSightStore;
+
const handleChange = (_: React.SyntheticEvent, newValue: number) => {
setValue(newValue);
};
let blocker = useBlocker(
({ currentLocation, nextLocation }) =>
- true && currentLocation.pathname !== nextLocation.pathname
+ needLeaveAgree && currentLocation.pathname !== nextLocation.pathname
);
useEffect(() => {
diff --git a/src/pages/EditSightPage/index.tsx b/src/pages/EditSightPage/index.tsx
index 6b1131b..63d5887 100644
--- a/src/pages/EditSightPage/index.tsx
+++ b/src/pages/EditSightPage/index.tsx
@@ -20,7 +20,7 @@ function a11yProps(index: number) {
export const EditSightPage = observer(() => {
const [value, setValue] = useState(0);
- const { sight, getSightInfo } = editSightStore;
+ const { sight, getSightInfo, needLeaveAgree } = editSightStore;
const { getArticles } = articlesStore;
const { language } = languageStore;
const { id } = useParams();
@@ -28,7 +28,7 @@ export const EditSightPage = observer(() => {
let blocker = useBlocker(
({ currentLocation, nextLocation }) =>
- true && currentLocation.pathname !== nextLocation.pathname
+ needLeaveAgree && currentLocation.pathname !== nextLocation.pathname
);
const handleChange = (_: React.SyntheticEvent, newValue: number) => {
diff --git a/src/pages/Sight/SightListPage/index.tsx b/src/pages/Sight/SightListPage/index.tsx
index adf635b..bd72138 100644
--- a/src/pages/Sight/SightListPage/index.tsx
+++ b/src/pages/Sight/SightListPage/index.tsx
@@ -4,7 +4,7 @@ import { useEffect, useState } from "react";
import { observer } from "mobx-react-lite";
import { Pencil, Trash2 } from "lucide-react";
import { useNavigate } from "react-router-dom";
-import { DeleteModal, LanguageSwitcher } from "@widgets";
+import { CreateButton, DeleteModal, LanguageSwitcher } from "@widgets";
export const SightListPage = observer(() => {
const { sights, getSights, deleteListSight } = sightsStore;
@@ -69,6 +69,13 @@ export const SightListPage = observer(() => {
+
+
Достопримечательности
+
+
-
-
+
- {articlesStore.articleMedia ? (
-
- ) : (
-
- )}
-
+ minWidth: 320,
+ maxWidth: 310,
-
-
- {articlesStore.articleData?.heading || "Название cтатьи"}
-
-
-
- {articlesStore.articleData?.body && (
-
+ {articlesStore.articleMedia ? (
+
+ ) : (
+
+ )}
- )}
-
+
+
+
+ {articlesStore.articleData?.heading || "Название cтатьи"}
+
+
+
+ {articlesStore.articleData?.body && (
+
+
+
+ )}
+
+
diff --git a/src/shared/modals/UploadMediaDialog/index.tsx b/src/shared/modals/UploadMediaDialog/index.tsx
index b3daf7f..aaa2978 100644
--- a/src/shared/modals/UploadMediaDialog/index.tsx
+++ b/src/shared/modals/UploadMediaDialog/index.tsx
@@ -1,4 +1,4 @@
-import { MEDIA_TYPE_LABELS, editSightStore } from "@shared";
+import { MEDIA_TYPE_LABELS, MEDIA_TYPE_VALUES, editSightStore } from "@shared";
import { observer } from "mobx-react-lite";
import { useEffect, useState } from "react";
import {
@@ -31,6 +31,7 @@ interface UploadMediaDialogProps {
media_type: number;
}) => void;
afterUploadSight?: (id: string) => void;
+ hardcodeType?: "thumbnail" | "watermark_lu" | "watermark_rd" | null;
}
export const UploadMediaDialog = observer(
@@ -39,6 +40,7 @@ export const UploadMediaDialog = observer(
onClose,
afterUpload,
afterUploadSight,
+ hardcodeType,
}: UploadMediaDialogProps) => {
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState(null);
@@ -165,10 +167,12 @@ export const UploadMediaDialog = observer(
Тип медиа
-
+
{mediaIds.map((m) => (
-
+