master
alex 2024-01-14 19:45:36 +01:00
parent 41d81e8f13
commit 2e4297ab64
2 changed files with 26 additions and 4 deletions

View File

@ -14,8 +14,6 @@ export default function StoreCalendarAuth() {
const [storeId, setStoreId] = useState(""); const [storeId, setStoreId] = useState("");
useEffect(() => { useEffect(() => {
setIsRequesting(true);
myFetch("/calendar/store", "GET") myFetch("/calendar/store", "GET")
.then((res) => { .then((res) => {
setIsRequesting(false); setIsRequesting(false);

View File

@ -1,10 +1,34 @@
import { Button } from "antd"; import { Button, Spin } from "antd";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Constants } from "../../../utils"; import { Constants, myFetch } from "../../../utils";
import { useEffect, useState } from "react";
import MyCenteredContainer from "../../../Components/MyContainer";
export default function StoreCalendar() { export default function StoreCalendar() {
const { t } = useTranslation(); const { t } = useTranslation();
const [isRequesting, setIsRequesting] = useState(true);
useEffect(() => {
myFetch("/calendar/settings", "GET")
.then((res) => {
console.log(res);
setIsRequesting(false);
})
.catch((err) => {
console.log(err);
});
}, []);
if (isRequesting) {
return (
<MyCenteredContainer>
<Spin size="large" />
</MyCenteredContainer>
);
}
return ( return (
<> <>
<h1>{t("calendar.pageTitle")}</h1> <h1>{t("calendar.pageTitle")}</h1>