feat: preview of installed app name on the schedule screen (#13221)
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Co-authored-by: Udit Takkar <udit222001@gmail.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: Omar López <zomars@me.com>
This commit is contained in:
2 files changed
+16
-2
No files matched your search
@@ -105,7 +105,6 @@ export const BookingFields = ({
|
||||
optionInput.placeholder = option.inputPlaceholder;
|
||||
}
|
||||
});
|
||||
|
||||
field.options = options.filter(
|
||||
(location): location is NonNullable<(typeof options)[number]> => !!location
|
||||
);
|
||||
|
||||
@@ -397,6 +397,21 @@ export const Components: Record<FieldType, Component> = {
|
||||
}, [options, setValue, value]);
|
||||
|
||||
const { t } = useLocale();
|
||||
|
||||
const getCleanLabel = (option: { label: string; value: string }): string | JSX.Element => {
|
||||
if (!option.label) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return option.label.search(/^https?:\/\//) !== -1 ? (
|
||||
<a href={option.label} target="_blank">
|
||||
<span className="underline">{option.label}</span>
|
||||
</a>
|
||||
) : (
|
||||
option.label
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div>
|
||||
@@ -419,7 +434,7 @@ export const Components: Record<FieldType, Component> = {
|
||||
}}
|
||||
checked={value?.value === option.value}
|
||||
/>
|
||||
<span className="text-emphasis me-2 ms-2 text-sm">{option.label ?? ""}</span>
|
||||
<span className="text-emphasis me-2 ms-2 text-sm">{getCleanLabel(option) ?? ""}</span>
|
||||
<span>
|
||||
{option.value === "phone" && (
|
||||
<InfoBadge content={t("number_in_international_format")} />
|
||||
|
||||
Reference in new issue
Block a user