fix: Update map with tables fixes

This commit is contained in:
2025-07-09 18:56:18 +03:00
parent 78800ee2ae
commit e2547cb571
87 changed files with 5392 additions and 1410 deletions

View File

@@ -43,6 +43,11 @@ export const CityEditPage = observer(() => {
const { getCountries } = countryStore;
const { getMedia, getOneMedia } = mediaStore;
useEffect(() => {
// Устанавливаем русский язык при загрузке страницы
languageStore.setLanguage("ru");
}, []);
const handleEdit = async () => {
try {
setIsLoading(true);
@@ -58,6 +63,7 @@ export const CityEditPage = observer(() => {
useEffect(() => {
(async () => {
if (id) {
await getCountries("ru");
// Fetch data for all languages
const ruData = await getCity(id as string, "ru");
const enData = await getCity(id as string, "en");
@@ -69,7 +75,7 @@ export const CityEditPage = observer(() => {
setEditCityData(zhData.name, zhData.country_code, zhData.arms, "zh");
await getOneMedia(ruData.arms as string);
await getCountries("ru");
await getMedia();
}
})();
@@ -174,15 +180,8 @@ export const CityEditPage = observer(() => {
setIsUploadMediaOpen(true);
setActiveMenuType("image");
}}
setHardcodeType={(type) => {
setActiveMenuType(
type as
| "thumbnail"
| "watermark_lu"
| "watermark_rd"
| "image"
| null
);
setHardcodeType={() => {
setActiveMenuType("image");
}}
/>
</div>
@@ -199,7 +198,7 @@ export const CityEditPage = observer(() => {
{isLoading ? (
<Loader2 size={20} className="animate-spin" />
) : (
"Обновить"
"Сохранить"
)}
</Button>
</div>
@@ -214,6 +213,8 @@ export const CityEditPage = observer(() => {
<UploadMediaDialog
open={isUploadMediaOpen}
onClose={() => setIsUploadMediaOpen(false)}
contextObjectName={editCityData[language].name}
contextType="city"
afterUpload={handleMediaSelect}
hardcodeType={
activeMenuType as