2
0

first commit

This commit is contained in:
2024-08-09 00:39:27 +02:00
commit 79688abe2e
5698 changed files with 497838 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
description: Easily generate a QR code for your links to print, share, or embed.
---
Easily generate a QR code for your links to print, share, or embed.

View File

@@ -0,0 +1,16 @@
import type { AppDeclarativeHandler } from "@calcom/types/AppHandler";
import { createDefaultInstallation } from "../../_utils/installation";
import appConfig from "../config.json";
const handler: AppDeclarativeHandler = {
appType: appConfig.type,
variant: appConfig.variant,
slug: appConfig.slug,
supportsMultipleInstalls: false,
handlerType: "add",
createCredential: ({ appType, user, slug, teamId }) =>
createDefaultInstallation({ appType, user: user, slug, key: {}, teamId }),
};
export default handler;

View File

@@ -0,0 +1 @@
export { default as add } from "./add";

View File

@@ -0,0 +1,32 @@
import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
import AppCard from "@calcom/app-store/_components/AppCard";
import useIsAppEnabled from "@calcom/app-store/_utils/useIsAppEnabled";
import type { EventTypeAppCardComponent } from "@calcom/app-store/types";
import type { appDataSchema } from "../zod";
import EventTypeAppSettingsInterface from "./EventTypeAppSettingsInterface";
const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({ eventType, app }) {
const { enabled, updateEnabled } = useIsAppEnabled(app);
const { disabled, getAppData, setAppData } = useAppContextWithSchema<typeof appDataSchema>();
return (
<AppCard
app={app}
switchOnClick={(e) => {
updateEnabled(e);
}}
switchChecked={enabled}
teamId={eventType.team?.id || undefined}>
<EventTypeAppSettingsInterface
eventType={eventType}
slug={app.slug}
disabled={disabled}
getAppData={getAppData}
setAppData={setAppData}
/>
</AppCard>
);
};
export default EventTypeAppCard;

View File

@@ -0,0 +1,55 @@
import { useState } from "react";
import type { EventTypeAppSettingsComponent } from "@calcom/app-store/types";
import { classNames } from "@calcom/lib";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { TextField, Tooltip } from "@calcom/ui";
const EventTypeAppSettingsInterface: EventTypeAppSettingsComponent = ({ eventType, disabled }) => {
const { t } = useLocale();
const [additionalParameters, setAdditionalParameters] = useState("");
const query = additionalParameters !== "" ? `?${additionalParameters}` : "";
const eventTypeURL = eventType.URL + query;
function QRCode({ size, data }: { size: number; data: string }) {
const QR_URL = `https://api.qrserver.com/v1/create-qr-code/?size=${size}&data=${data}`;
return (
<Tooltip content={eventTypeURL}>
<a download href={QR_URL} target="_blank" rel="noreferrer">
<img
className={classNames(
"hover:bg-muted border-default border hover:shadow-sm",
size >= 256 && "min-h-32"
)}
style={{ padding: size / 16, borderRadius: size / 20 }}
width={size}
src={QR_URL}
alt={eventTypeURL}
/>
</a>
</Tooltip>
);
}
return (
<div className="flex w-full flex-col gap-5 text-sm">
<div className="flex w-full">
<TextField
name="hello"
disabled={disabled}
value={additionalParameters}
onChange={(e) => setAdditionalParameters(e.target.value)}
label={t("additional_url_parameters")}
containerClassName="w-full"
/>
</div>
<div className="max-w-60 flex items-baseline gap-2">
<QRCode size={256} data={eventTypeURL} />
<QRCode size={128} data={eventTypeURL} />
<QRCode size={64} data={eventTypeURL} />
</div>
</div>
);
};
export default EventTypeAppSettingsInterface;

View File

@@ -0,0 +1,16 @@
{
"/*": "Don't modify slug - If required, do it using cli edit command",
"name": "QR Code",
"slug": "qr_code",
"type": "qr_code_other",
"logo": "icon.svg",
"url": "https://cal.com/",
"variant": "other",
"categories": ["other"],
"extendsFeature": "EventType",
"publisher": "Cal.com, Inc.",
"email": "support@cal.com",
"description": "Easily generate a QR code for your links to print, share, or embed.",
"__createdUsingCli": true,
"isOAuth": false
}

View File

@@ -0,0 +1 @@
export * as api from "./api";

View File

@@ -0,0 +1,14 @@
{
"$schema": "https://json.schemastore.org/package.json",
"private": true,
"name": "@calcom/qr_code",
"version": "0.0.0",
"main": "./index.ts",
"description": "Easily generate a QR code of your links",
"dependencies": {
"@calcom/lib": "*"
},
"devDependencies": {
"@calcom/types": "*"
}
}

View File

@@ -0,0 +1,244 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="232" height="232" viewBox="0 0 232 232"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events">
<rect x="0" y="0" width="232" height="232" fill="#ffffff"/>
<defs>
<rect id="p" width="8" height="8"/>
</defs>
<g fill="#000000">
<use xlink:href="#p" x="32" y="32"/>
<use xlink:href="#p" x="32" y="40"/>
<use xlink:href="#p" x="32" y="48"/>
<use xlink:href="#p" x="32" y="56"/>
<use xlink:href="#p" x="32" y="64"/>
<use xlink:href="#p" x="32" y="72"/>
<use xlink:href="#p" x="32" y="80"/>
<use xlink:href="#p" x="32" y="96"/>
<use xlink:href="#p" x="32" y="104"/>
<use xlink:href="#p" x="32" y="120"/>
<use xlink:href="#p" x="32" y="144"/>
<use xlink:href="#p" x="32" y="152"/>
<use xlink:href="#p" x="32" y="160"/>
<use xlink:href="#p" x="32" y="168"/>
<use xlink:href="#p" x="32" y="176"/>
<use xlink:href="#p" x="32" y="184"/>
<use xlink:href="#p" x="32" y="192"/>
<use xlink:href="#p" x="40" y="32"/>
<use xlink:href="#p" x="40" y="80"/>
<use xlink:href="#p" x="40" y="96"/>
<use xlink:href="#p" x="40" y="144"/>
<use xlink:href="#p" x="40" y="192"/>
<use xlink:href="#p" x="48" y="32"/>
<use xlink:href="#p" x="48" y="48"/>
<use xlink:href="#p" x="48" y="56"/>
<use xlink:href="#p" x="48" y="64"/>
<use xlink:href="#p" x="48" y="80"/>
<use xlink:href="#p" x="48" y="96"/>
<use xlink:href="#p" x="48" y="104"/>
<use xlink:href="#p" x="48" y="112"/>
<use xlink:href="#p" x="48" y="120"/>
<use xlink:href="#p" x="48" y="144"/>
<use xlink:href="#p" x="48" y="160"/>
<use xlink:href="#p" x="48" y="168"/>
<use xlink:href="#p" x="48" y="176"/>
<use xlink:href="#p" x="48" y="192"/>
<use xlink:href="#p" x="56" y="32"/>
<use xlink:href="#p" x="56" y="48"/>
<use xlink:href="#p" x="56" y="56"/>
<use xlink:href="#p" x="56" y="64"/>
<use xlink:href="#p" x="56" y="80"/>
<use xlink:href="#p" x="56" y="96"/>
<use xlink:href="#p" x="56" y="104"/>
<use xlink:href="#p" x="56" y="120"/>
<use xlink:href="#p" x="56" y="128"/>
<use xlink:href="#p" x="56" y="144"/>
<use xlink:href="#p" x="56" y="160"/>
<use xlink:href="#p" x="56" y="168"/>
<use xlink:href="#p" x="56" y="176"/>
<use xlink:href="#p" x="56" y="192"/>
<use xlink:href="#p" x="64" y="32"/>
<use xlink:href="#p" x="64" y="48"/>
<use xlink:href="#p" x="64" y="56"/>
<use xlink:href="#p" x="64" y="64"/>
<use xlink:href="#p" x="64" y="80"/>
<use xlink:href="#p" x="64" y="104"/>
<use xlink:href="#p" x="64" y="112"/>
<use xlink:href="#p" x="64" y="144"/>
<use xlink:href="#p" x="64" y="160"/>
<use xlink:href="#p" x="64" y="168"/>
<use xlink:href="#p" x="64" y="176"/>
<use xlink:href="#p" x="64" y="192"/>
<use xlink:href="#p" x="72" y="32"/>
<use xlink:href="#p" x="72" y="80"/>
<use xlink:href="#p" x="72" y="104"/>
<use xlink:href="#p" x="72" y="112"/>
<use xlink:href="#p" x="72" y="144"/>
<use xlink:href="#p" x="72" y="192"/>
<use xlink:href="#p" x="80" y="32"/>
<use xlink:href="#p" x="80" y="40"/>
<use xlink:href="#p" x="80" y="48"/>
<use xlink:href="#p" x="80" y="56"/>
<use xlink:href="#p" x="80" y="64"/>
<use xlink:href="#p" x="80" y="72"/>
<use xlink:href="#p" x="80" y="80"/>
<use xlink:href="#p" x="80" y="96"/>
<use xlink:href="#p" x="80" y="112"/>
<use xlink:href="#p" x="80" y="128"/>
<use xlink:href="#p" x="80" y="144"/>
<use xlink:href="#p" x="80" y="152"/>
<use xlink:href="#p" x="80" y="160"/>
<use xlink:href="#p" x="80" y="168"/>
<use xlink:href="#p" x="80" y="176"/>
<use xlink:href="#p" x="80" y="184"/>
<use xlink:href="#p" x="80" y="192"/>
<use xlink:href="#p" x="88" y="112"/>
<use xlink:href="#p" x="88" y="120"/>
<use xlink:href="#p" x="96" y="32"/>
<use xlink:href="#p" x="96" y="48"/>
<use xlink:href="#p" x="96" y="56"/>
<use xlink:href="#p" x="96" y="64"/>
<use xlink:href="#p" x="96" y="80"/>
<use xlink:href="#p" x="96" y="96"/>
<use xlink:href="#p" x="96" y="104"/>
<use xlink:href="#p" x="96" y="112"/>
<use xlink:href="#p" x="96" y="120"/>
<use xlink:href="#p" x="96" y="136"/>
<use xlink:href="#p" x="96" y="168"/>
<use xlink:href="#p" x="96" y="176"/>
<use xlink:href="#p" x="96" y="184"/>
<use xlink:href="#p" x="96" y="192"/>
<use xlink:href="#p" x="104" y="48"/>
<use xlink:href="#p" x="104" y="56"/>
<use xlink:href="#p" x="104" y="72"/>
<use xlink:href="#p" x="104" y="96"/>
<use xlink:href="#p" x="104" y="104"/>
<use xlink:href="#p" x="104" y="112"/>
<use xlink:href="#p" x="104" y="120"/>
<use xlink:href="#p" x="104" y="136"/>
<use xlink:href="#p" x="104" y="144"/>
<use xlink:href="#p" x="104" y="152"/>
<use xlink:href="#p" x="104" y="160"/>
<use xlink:href="#p" x="104" y="168"/>
<use xlink:href="#p" x="104" y="176"/>
<use xlink:href="#p" x="112" y="32"/>
<use xlink:href="#p" x="112" y="40"/>
<use xlink:href="#p" x="112" y="72"/>
<use xlink:href="#p" x="112" y="80"/>
<use xlink:href="#p" x="112" y="96"/>
<use xlink:href="#p" x="112" y="104"/>
<use xlink:href="#p" x="112" y="136"/>
<use xlink:href="#p" x="112" y="144"/>
<use xlink:href="#p" x="112" y="184"/>
<use xlink:href="#p" x="112" y="192"/>
<use xlink:href="#p" x="120" y="40"/>
<use xlink:href="#p" x="120" y="48"/>
<use xlink:href="#p" x="120" y="56"/>
<use xlink:href="#p" x="120" y="64"/>
<use xlink:href="#p" x="120" y="72"/>
<use xlink:href="#p" x="120" y="96"/>
<use xlink:href="#p" x="120" y="120"/>
<use xlink:href="#p" x="120" y="136"/>
<use xlink:href="#p" x="120" y="144"/>
<use xlink:href="#p" x="120" y="184"/>
<use xlink:href="#p" x="120" y="192"/>
<use xlink:href="#p" x="128" y="32"/>
<use xlink:href="#p" x="128" y="64"/>
<use xlink:href="#p" x="128" y="80"/>
<use xlink:href="#p" x="128" y="88"/>
<use xlink:href="#p" x="128" y="96"/>
<use xlink:href="#p" x="128" y="120"/>
<use xlink:href="#p" x="128" y="128"/>
<use xlink:href="#p" x="128" y="136"/>
<use xlink:href="#p" x="128" y="160"/>
<use xlink:href="#p" x="128" y="168"/>
<use xlink:href="#p" x="128" y="176"/>
<use xlink:href="#p" x="128" y="192"/>
<use xlink:href="#p" x="136" y="96"/>
<use xlink:href="#p" x="136" y="104"/>
<use xlink:href="#p" x="136" y="112"/>
<use xlink:href="#p" x="136" y="152"/>
<use xlink:href="#p" x="136" y="168"/>
<use xlink:href="#p" x="136" y="176"/>
<use xlink:href="#p" x="136" y="184"/>
<use xlink:href="#p" x="136" y="192"/>
<use xlink:href="#p" x="144" y="32"/>
<use xlink:href="#p" x="144" y="40"/>
<use xlink:href="#p" x="144" y="48"/>
<use xlink:href="#p" x="144" y="56"/>
<use xlink:href="#p" x="144" y="64"/>
<use xlink:href="#p" x="144" y="72"/>
<use xlink:href="#p" x="144" y="80"/>
<use xlink:href="#p" x="144" y="104"/>
<use xlink:href="#p" x="144" y="128"/>
<use xlink:href="#p" x="144" y="136"/>
<use xlink:href="#p" x="144" y="144"/>
<use xlink:href="#p" x="144" y="184"/>
<use xlink:href="#p" x="144" y="192"/>
<use xlink:href="#p" x="152" y="32"/>
<use xlink:href="#p" x="152" y="80"/>
<use xlink:href="#p" x="152" y="104"/>
<use xlink:href="#p" x="152" y="120"/>
<use xlink:href="#p" x="152" y="152"/>
<use xlink:href="#p" x="152" y="168"/>
<use xlink:href="#p" x="152" y="176"/>
<use xlink:href="#p" x="152" y="184"/>
<use xlink:href="#p" x="160" y="32"/>
<use xlink:href="#p" x="160" y="48"/>
<use xlink:href="#p" x="160" y="56"/>
<use xlink:href="#p" x="160" y="64"/>
<use xlink:href="#p" x="160" y="80"/>
<use xlink:href="#p" x="160" y="96"/>
<use xlink:href="#p" x="160" y="104"/>
<use xlink:href="#p" x="160" y="128"/>
<use xlink:href="#p" x="160" y="136"/>
<use xlink:href="#p" x="160" y="144"/>
<use xlink:href="#p" x="160" y="152"/>
<use xlink:href="#p" x="160" y="160"/>
<use xlink:href="#p" x="160" y="184"/>
<use xlink:href="#p" x="160" y="192"/>
<use xlink:href="#p" x="168" y="32"/>
<use xlink:href="#p" x="168" y="48"/>
<use xlink:href="#p" x="168" y="56"/>
<use xlink:href="#p" x="168" y="64"/>
<use xlink:href="#p" x="168" y="80"/>
<use xlink:href="#p" x="168" y="96"/>
<use xlink:href="#p" x="168" y="104"/>
<use xlink:href="#p" x="168" y="112"/>
<use xlink:href="#p" x="168" y="120"/>
<use xlink:href="#p" x="168" y="128"/>
<use xlink:href="#p" x="168" y="152"/>
<use xlink:href="#p" x="168" y="192"/>
<use xlink:href="#p" x="176" y="32"/>
<use xlink:href="#p" x="176" y="48"/>
<use xlink:href="#p" x="176" y="56"/>
<use xlink:href="#p" x="176" y="64"/>
<use xlink:href="#p" x="176" y="80"/>
<use xlink:href="#p" x="176" y="96"/>
<use xlink:href="#p" x="176" y="104"/>
<use xlink:href="#p" x="176" y="152"/>
<use xlink:href="#p" x="176" y="160"/>
<use xlink:href="#p" x="176" y="176"/>
<use xlink:href="#p" x="176" y="192"/>
<use xlink:href="#p" x="184" y="32"/>
<use xlink:href="#p" x="184" y="80"/>
<use xlink:href="#p" x="184" y="104"/>
<use xlink:href="#p" x="184" y="112"/>
<use xlink:href="#p" x="184" y="120"/>
<use xlink:href="#p" x="184" y="152"/>
<use xlink:href="#p" x="184" y="160"/>
<use xlink:href="#p" x="184" y="168"/>
<use xlink:href="#p" x="192" y="32"/>
<use xlink:href="#p" x="192" y="40"/>
<use xlink:href="#p" x="192" y="48"/>
<use xlink:href="#p" x="192" y="56"/>
<use xlink:href="#p" x="192" y="64"/>
<use xlink:href="#p" x="192" y="72"/>
<use xlink:href="#p" x="192" y="80"/>
<use xlink:href="#p" x="192" y="96"/>
<use xlink:href="#p" x="192" y="104"/>
<use xlink:href="#p" x="192" y="112"/>
<use xlink:href="#p" x="192" y="128"/>
<use xlink:href="#p" x="192" y="152"/>
<use xlink:href="#p" x="192" y="184"/>
</g>
<g></g></svg>

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@@ -0,0 +1,7 @@
import { z } from "zod";
import { eventTypeAppCardZod } from "../eventTypeAppCardZod";
export const appDataSchema = eventTypeAppCardZod;
export const appKeysSchema = z.object({});