Skip to content

Scheduling infrastructure for absolutely everyone.

feat: add additional parameters for QR code generator app (#9177)

Nafees Nazik6bc713bc2eb5
diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json
index 7405f670280..56f2af54813 100644
--- a/apps/web/public/static/locales/en/common.json
+++ b/apps/web/public/static/locales/en/common.json
@@ -1840,5 +1840,6 @@
"connect_google_workspace":"Connect Google Workspace",
"google_workspace_admin_tooltip":"You must be a Workspace Admin to use this feature",
"first_event_type_webhook_description": "Create your first webhook for this event type",
- "create_for": "Create for"
+ "create_for": "Create for",
+ "additional_url_parameters":"Additional URL parameters"
}
diff --git a/packages/app-store/qr_code/components/EventTypeAppCardInterface.tsx b/packages/app-store/qr_code/components/EventTypeAppCardInterface.tsx
index e88c36e945c..fbb89118a25 100644
--- a/packages/app-store/qr_code/components/EventTypeAppCardInterface.tsx
+++ b/packages/app-store/qr_code/components/EventTypeAppCardInterface.tsx
@@ -3,15 +3,19 @@ import { useState } from "react";
import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
import AppCard from "@calcom/app-store/_components/AppCard";
import type { EventTypeAppCardComponent } from "@calcom/app-store/types";
-import { Tooltip } from "@calcom/ui";
+import { useLocale } from "@calcom/lib/hooks/useLocale";
+import { Tooltip, TextField } from "@calcom/ui";
import type { appDataSchema } from "../zod";
const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({ eventType, app }) {
+ const { t } = useLocale();
const [getAppData, setAppData] = useAppContextWithSchema<typeof appDataSchema>();
const [enabled, setEnabled] = useState(getAppData("enabled"));
+ const [additionalParameters, setAdditionalParameters] = useState("");
- const eventTypeURL = eventType.URL;
+ 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;
@@ -19,7 +23,7 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
<Tooltip content={eventTypeURL}>
<a download href={QR_URL} target="_blank" rel="noreferrer">
<img
- className="hover:bg-muted border hover:shadow-sm"
+ className="hover:bg-muted border-default border hover:shadow-sm"
style={{ padding: size / 16, borderRadius: size / 20 }}
width={size}
src={QR_URL}
@@ -42,10 +46,22 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
}
}}
switchChecked={enabled}>
- <div className="max-w-60 flex items-baseline justify-between gap-2 text-sm ">
- <QRCode size={256} data={eventTypeURL} />
- <QRCode size={128} data={eventTypeURL} />
- <QRCode size={64} data={eventTypeURL} />
+ <div className="flex w-full flex-col gap-2 text-sm">
+ <div className="flex w-full">
+ <TextField
+ name="hello"
+ 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>
</AppCard>
);