feat: Select article list in sight
This commit is contained in:
@ -1,7 +1,9 @@
|
||||
import { Box, Tab, Tabs } from "@mui/material";
|
||||
import { articlesStore, cityStore } from "@shared";
|
||||
import { InformationTab, RightWidgetTab } from "@widgets";
|
||||
import { LeftWidgetTab } from "@widgets";
|
||||
import { useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { observer } from "mobx-react-lite";
|
||||
|
||||
function a11yProps(index: number) {
|
||||
return {
|
||||
@ -10,13 +12,19 @@ function a11yProps(index: number) {
|
||||
};
|
||||
}
|
||||
|
||||
export const CreateSightPage = () => {
|
||||
export const CreateSightPage = observer(() => {
|
||||
const [value, setValue] = useState(0);
|
||||
|
||||
const { getCities } = cityStore;
|
||||
const { getArticles } = articlesStore;
|
||||
const handleChange = (_: React.SyntheticEvent, newValue: number) => {
|
||||
setValue(newValue);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getCities();
|
||||
getArticles();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
@ -58,4 +66,4 @@ export const CreateSightPage = () => {
|
||||
</div>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
@ -3,7 +3,7 @@ import { InformationTab, RightWidgetTab } from "@widgets";
|
||||
import { LeftWidgetTab } from "@widgets";
|
||||
import { useEffect, useState } from "react";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { languageStore, sightsStore } from "@shared";
|
||||
import { articlesStore, languageStore, sightsStore } from "@shared";
|
||||
import { useParams } from "react-router-dom";
|
||||
|
||||
function a11yProps(index: number) {
|
||||
@ -16,6 +16,7 @@ function a11yProps(index: number) {
|
||||
export const EditSightPage = observer(() => {
|
||||
const [value, setValue] = useState(0);
|
||||
const { sight, getSight } = sightsStore;
|
||||
const { getArticles } = articlesStore;
|
||||
const { language } = languageStore;
|
||||
const { id } = useParams();
|
||||
|
||||
@ -27,6 +28,7 @@ export const EditSightPage = observer(() => {
|
||||
const fetchData = async () => {
|
||||
if (id) {
|
||||
await getSight(Number(id));
|
||||
await getArticles();
|
||||
}
|
||||
};
|
||||
fetchData();
|
||||
|
Reference in New Issue
Block a user