diff --git a/public/locales/de/translation.json b/public/locales/de/translation.json index 838317e..8a165bc 100644 --- a/public/locales/de/translation.json +++ b/public/locales/de/translation.json @@ -161,6 +161,11 @@ }, "cardStoreCalendarSettings": { "title": "Geschäftskalendereinstellungen" + }, + "googleCalendarNotConnected": { + "title": "Google Kalender nicht verbunden", + "subTitle": "Klicken Sie auf die Schaltfläche unten, um Ihren Google Kalender zu verbinden.", + "button": "Jetzt verbinden" } }, "storeSettings": { diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 04b6a7c..edf9197 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -164,6 +164,11 @@ }, "cardStoreCalendarSettings": { "title": "Store calendar settings" + }, + "googleCalendarNotConnected": { + "title": "Google Calendar not connected", + "subTitle": "Click on the button below to connect your Google Calendar.", + "button": "Connect now" } }, "storeSettings": { diff --git a/src/Components/MyContainer/index.js b/src/Components/MyContainer/index.js index 4f0e40e..8349185 100644 --- a/src/Components/MyContainer/index.js +++ b/src/Components/MyContainer/index.js @@ -7,7 +7,7 @@ export default function MyCenteredContainer({ children }) { justifyContent: "center", alignContent: "center", alignItems: "center", - height: "98.3vh", + height: "85.3vh", }} > {children} diff --git a/src/Pages/Store/Calendar/index.js b/src/Pages/Store/Calendar/index.js index eb42139..dfd6b94 100644 --- a/src/Pages/Store/Calendar/index.js +++ b/src/Pages/Store/Calendar/index.js @@ -1,4 +1,4 @@ -import { Button, Card, Col, Form, Row, Spin, Switch, Typography } from "antd"; +import { Button, Card, Col, Form, Result, Row, Spin, Switch } from "antd"; import { useTranslation } from "react-i18next"; import { Constants, @@ -7,7 +7,6 @@ import { } from "../../../utils"; import { useEffect, useRef, useState } from "react"; import MyCenteredContainer from "../../../Components/MyContainer"; -import { CheckOutlined } from "@ant-design/icons"; import { MyCalendarMaxFutureBookingDaysFormInput, MyCalendarMinEarliestBookingTimeFormInput, @@ -47,32 +46,46 @@ export default function StoreCalendar() { return ( <> -

{t("calendar.pageTitle")}

+ {calendarSettings.connected === false ? ( + + { + document.cookie = `session=${getUserSessionFromLocalStorage()}; path=/;`; - - - - - + {t("calendar.googleCalendarNotConnected.button")} + + } /> - - - {calendarSettings.storeSettings && ( - - )} - - + + ) : ( + <> +

{t("calendar.pageTitle")}

+ + + + + + + {calendarSettings.storeSettings && ( + + )} + + + + )} ); } @@ -175,7 +188,7 @@ function CardStoreCalendarSettings({ settings }) { }, []); useEffect(() => { - // undefined on first render+ + // undefined on first render // null when input is empty if ( calendarMaxFutureBookingDays === undefined || diff --git a/src/Pages/Store/Employees/index.js b/src/Pages/Store/Employees/index.js index bac4b30..f7f0039 100644 --- a/src/Pages/Store/Employees/index.js +++ b/src/Pages/Store/Employees/index.js @@ -1,12 +1,5 @@ import { PlusOutlined } from "@ant-design/icons"; -import { - Button, - Checkbox, - Form, - Grid, - Popconfirm, - Space, -} from "antd"; +import { Button, Checkbox, Form, Grid, Popconfirm, Space } from "antd"; import MyModal, { MyModalCloseCreateButtonFooter, MyModalCloseSaveButtonFooter, @@ -57,12 +50,12 @@ export default function StoreEmployees() { key: "username", }, { - title: t("common.maxFutureBookingDays"), + title: t("common.calendarMaxFutureBookingDays"), dataIndex: "calendarMaxFutureBookingDays", key: "calendarMaxFutureBookingDays", }, { - title: t("common.minEarliestBookingTime"), + title: t("common.calendarMinEarliestBookingTime"), dataIndex: "calendarMinEarliestBookingTime", key: "calendarMinEarliestBookingTime", },