Skip to content

Commit 06f4b25

Browse files
CarinaWollidevin-ai-integration[bot]CarinaWolli
authored
fix: update routing form identifier hint text with learn more link (calcom#27837)
* fix: update routing form identifier hint text with learn more link Co-Authored-By: carina@cal.com <c.wollendorfer@me.com> * UI improvements --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: CarinaWolli <wollencarina@gmail.com>
1 parent 79fc0c8 commit 06f4b25

4 files changed

Lines changed: 26 additions & 17 deletions

File tree

apps/web/app/(use-page-wrapper)/apps/routing-forms/[...pages]/FormEdit.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { FieldTypes } from "@calcom/app-store/routing-forms/lib/FieldTypes";
44
import type { RoutingFormWithResponseCount } from "@calcom/app-store/routing-forms/types/types";
5+
import { LearnMoreLink } from "@calcom/features/eventtypes/components/LearnMoreLink";
56
import { getFieldIdentifier } from "@calcom/features/form-builder/utils/getFieldIdentifier";
67
import { useLocale } from "@calcom/lib/hooks/useLocale";
78
import classNames from "@calcom/ui/classNames";
@@ -132,7 +133,13 @@ function Field({
132133
<TextField
133134
disabled={!!router}
134135
label={t("identifier_url_parameter")}
135-
hint={t("identifier_url_parameter_hint")}
136+
hint={
137+
<LearnMoreLink
138+
t={t}
139+
i18nKey="identifier_url_parameter_hint"
140+
href="https://cal.com/help/routing/connect-routing-form-to-booking-questions"
141+
/>
142+
}
136143
name={`${hookFieldNamespace}.identifier`}
137144
required
138145
placeholder={t("identifies_name_field")}

apps/web/public/static/locales/en/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2563,7 +2563,7 @@
25632563
"this_is_what_your_users_would_see": "This is what your users would see",
25642564
"identifies_name_field": "Identifies field by this name.",
25652565
"identifier_url_parameter": "Identifier",
2566-
"identifier_url_parameter_hint": "Used for URL parameters, like &name=john",
2566+
"identifier_url_parameter_hint": "Passed as a URL parameter and can be used to prefill booking questions, e.g. &name=john. <0>Learn more</0>",
25672567
"add_1_option_per_line": "Add 1 option per line",
25682568
"select_a_router": "Select a router",
25692569
"add_a_new_route": "Add a new route",

packages/features/eventtypes/components/LearnMoreLink.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,21 @@ export const LearnMoreLink = ({ t, i18nKey, href }: LearnMoreLinkProps) => {
1919
}
2020

2121
return (
22-
<ServerTrans
23-
t={t}
24-
i18nKey={i18nKey}
25-
components={[
26-
<Link
27-
key={i18nKey}
28-
className="underline underline-offset-2"
29-
target="_blank"
30-
rel="noopener noreferrer"
31-
href={href}>
32-
Learn more
33-
</Link>,
34-
]}
35-
/>
22+
<span>
23+
<ServerTrans
24+
t={t}
25+
i18nKey={i18nKey}
26+
components={[
27+
<Link
28+
key={i18nKey}
29+
className="underline underline-offset-2"
30+
target="_blank"
31+
rel="noopener noreferrer"
32+
href={href}>
33+
Learn more
34+
</Link>,
35+
]}
36+
/>
37+
</span>
3638
);
3739
};

packages/ui/components/form/inputs/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export type InputFieldProps<Translations extends Record<string, string> = object
66
translations?: Translations;
77
label?: React.ReactNode;
88
LockedIcon?: React.ReactNode;
9-
hint?: string;
9+
hint?: React.ReactNode;
1010
hintErrors?: string[];
1111
addOnLeading?: React.ReactNode;
1212
addOnSuffix?: React.ReactNode;

0 commit comments

Comments
 (0)