From 2e4297ab64e22b9711d0841437378219e5a4d659 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 14 Jan 2024 19:45:36 +0100 Subject: [PATCH] settings --- src/Pages/Store/Calendar/Auth/index.js | 2 -- src/Pages/Store/Calendar/index.js | 28 ++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/Pages/Store/Calendar/Auth/index.js b/src/Pages/Store/Calendar/Auth/index.js index 241cc52..fda5280 100644 --- a/src/Pages/Store/Calendar/Auth/index.js +++ b/src/Pages/Store/Calendar/Auth/index.js @@ -14,8 +14,6 @@ export default function StoreCalendarAuth() { const [storeId, setStoreId] = useState(""); useEffect(() => { - setIsRequesting(true); - myFetch("/calendar/store", "GET") .then((res) => { setIsRequesting(false); diff --git a/src/Pages/Store/Calendar/index.js b/src/Pages/Store/Calendar/index.js index 9f485d4..95829eb 100644 --- a/src/Pages/Store/Calendar/index.js +++ b/src/Pages/Store/Calendar/index.js @@ -1,10 +1,34 @@ -import { Button } from "antd"; +import { Button, Spin } from "antd"; 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() { 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 ( + + + + ); + } + return ( <>

{t("calendar.pageTitle")}