master
alex 2024-01-14 10:59:42 +01:00
parent da34c2abd5
commit 117f1889a6
4 changed files with 43 additions and 1 deletions

6
package-lock.json generated
View File

@ -16,6 +16,7 @@
"@yudiel/react-qr-scanner": "^1.1.10", "@yudiel/react-qr-scanner": "^1.1.10",
"antd": "^5.10.3", "antd": "^5.10.3",
"buffer": "^6.0.3", "buffer": "^6.0.3",
"hellojs": "^1.20.0",
"i18next": "^23.2.3", "i18next": "^23.2.3",
"i18next-browser-languagedetector": "^7.1.0", "i18next-browser-languagedetector": "^7.1.0",
"i18next-http-backend": "^2.2.1", "i18next-http-backend": "^2.2.1",
@ -11173,6 +11174,11 @@
"he": "bin/he" "he": "bin/he"
} }
}, },
"node_modules/hellojs": {
"version": "1.20.0",
"resolved": "https://registry.npmjs.org/hellojs/-/hellojs-1.20.0.tgz",
"integrity": "sha512-zfZGRt0J0OpJHnw2GJz4uh+rzMNAMWpIymiaRbSmCqCvqDMLSx2/qR5JucqnHPsZHUEjyKj5aLJ8K54kyHHjLQ=="
},
"node_modules/hoopy": { "node_modules/hoopy": {
"version": "0.1.4", "version": "0.1.4",
"resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz", "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz",

View File

@ -11,6 +11,7 @@
"@yudiel/react-qr-scanner": "^1.1.10", "@yudiel/react-qr-scanner": "^1.1.10",
"antd": "^5.10.3", "antd": "^5.10.3",
"buffer": "^6.0.3", "buffer": "^6.0.3",
"hellojs": "^1.20.0",
"i18next": "^23.2.3", "i18next": "^23.2.3",
"i18next-browser-languagedetector": "^7.1.0", "i18next-browser-languagedetector": "^7.1.0",
"i18next-http-backend": "^2.2.1", "i18next-http-backend": "^2.2.1",

View File

@ -1,15 +1,48 @@
import { Button } from "antd"; import { Button } from "antd";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Constants } from "../../../utils"; import { Constants } from "../../../utils";
import * as hello from "hellojs";
import { useEffect } from "react";
export default function StoreCalendar() { export default function StoreCalendar() {
const { t } = useTranslation(); const { t } = useTranslation();
useEffect(() => {
hello.init(
{
google: Constants.GOOGLE_CLIENT_ID,
},
{
response_type: "code",
redirect_uri:
"https://customerdashboard.ex.umbach.dev/store/calendar/finish",
scope: [
"https://www.googleapis.com/auth/calendar.app.created",
"https://www.googleapis.com/auth/calendar.events.freebusy",
],
force: true,
}
);
}, []);
return ( return (
<> <>
<h1>{t("calendar.pageTitle")}</h1> <h1>{t("calendar.pageTitle")}</h1>
<Button href={`${Constants.API_ADDRESS}/calendar/auth/google`}> <Button
onClick={() => {
hello("google")
.login()
.then(
() => {
console.log("login success");
},
(e) => {
console.log("login error", e);
}
);
}}
>
LOGIN with GOOGLE LOGIN with GOOGLE
</Button> </Button>
</> </>

View File

@ -75,6 +75,8 @@ export const Constants = {
MAX_STORE_SERVICE_ACTIVITY_DURATION_MINUTES: 59, MAX_STORE_SERVICE_ACTIVITY_DURATION_MINUTES: 59,
}, },
DELAY_ACCOUNT_NAME_CHECK: 250, DELAY_ACCOUNT_NAME_CHECK: 250,
GOOGLE_CLIENT_ID:
"128055018065-3qkae3nocsscq909vu3lttljro2srt3c.apps.googleusercontent.com",
MAX_AVATAR_SIZE: 5 * 1024 * 1024, MAX_AVATAR_SIZE: 5 * 1024 * 1024,
ACCEPTED_AVATAR_FILE_TYPES: [ ACCEPTED_AVATAR_FILE_TYPES: [
"image/png", "image/png",