Translations (#900)
* Translations * Variables to Translated Words * Fix Translations * Fix Title to Create Events Types Co-authored-by: Bailey Pumfleet <[email protected]>
This commit is contained in:
1 parent
8cbf880af6
commit
82f11b5121
4 files changed
+370
-201
No files matched your search
@@ -85,7 +85,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
const { eventType, locationOptions, availability, team, teamMembers, hasPaymentIntegration, currency } =
|
||||
props;
|
||||
|
||||
const { locale } = useLocale({ localeProp: props.localeProp });
|
||||
const { t, locale } = useLocale({ localeProp: props.localeProp });
|
||||
const router = useRouter();
|
||||
const [successModalOpen, setSuccessModalOpen] = useState(false);
|
||||
|
||||
@@ -112,9 +112,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
});
|
||||
|
||||
const [users, setUsers] = useState<AdvancedOptions["users"]>([]);
|
||||
|
||||
const [editIcon, setEditIcon] = useState(true);
|
||||
|
||||
const [enteredAvailability, setEnteredAvailability] = useState();
|
||||
const [showLocationModal, setShowLocationModal] = useState(false);
|
||||
const [selectedTimeZone, setSelectedTimeZone] = useState("");
|
||||
@@ -166,7 +164,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
advancedPayload.price =
|
||||
!requirePayment ? undefined :
|
||||
formData.price ? Math.round(parseFloat(asStringOrThrow(formData.price)) * 100) :
|
||||
/* otherwise */ 0;
|
||||
/* otherwise */ 0;
|
||||
advancedPayload.currency = currency;
|
||||
}
|
||||
|
||||
@@ -250,7 +248,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
return (
|
||||
<div>
|
||||
<label htmlFor="address" className="block text-sm font-medium text-gray-700">
|
||||
Set an address or place
|
||||
{t("set_address_place")}
|
||||
</label>
|
||||
<div className="mt-1">
|
||||
<input
|
||||
@@ -265,15 +263,13 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
</div>
|
||||
);
|
||||
case LocationType.Phone:
|
||||
return (
|
||||
<p className="text-sm">Cal will ask your invitee to enter a phone number before scheduling.</p>
|
||||
);
|
||||
return <p className="text-sm">{t("cal_invitee_phone_number_scheduling")}</p>;
|
||||
case LocationType.GoogleMeet:
|
||||
return <p className="text-sm">Cal will provide a Google Meet location.</p>;
|
||||
return <p className="text-sm">{t("cal_provide_google_meet_location")}</p>;
|
||||
case LocationType.Zoom:
|
||||
return <p className="text-sm">Cal will provide a Zoom meeting URL.</p>;
|
||||
return <p className="text-sm">{t("cal_provide_zoom_meeting_url")}</p>;
|
||||
case LocationType.Daily:
|
||||
return <p className="text-sm">Cal will provide a video meeting URL.</p>;
|
||||
return <p className="text-sm">{t("cal_provide_video_meeting_url")}</p>;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
@@ -325,7 +321,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
centered
|
||||
title={`${eventType.title} | Event Type`}
|
||||
heading={
|
||||
<div className="relative group -mb-2" onClick={() => setEditIcon(false)}>
|
||||
<div className="relative -mb-2 group" onClick={() => setEditIcon(false)}>
|
||||
<input
|
||||
ref={titleRef}
|
||||
type="text"
|
||||
@@ -345,16 +341,16 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
</div>
|
||||
}
|
||||
subtitle={eventType.description || ""}>
|
||||
<div className="block sm:flex md:max-w-5xl mx-auto">
|
||||
<div className="block mx-auto sm:flex md:max-w-5xl">
|
||||
<div className="w-full mr-2 sm:w-9/12">
|
||||
<div className="p-4 py-6 -mx-4 bg-white border rounded-sm border-neutral-200 sm:mx-0 sm:px-8">
|
||||
<form onSubmit={updateEventTypeHandler} className="space-y-6">
|
||||
<div className="space-y-3">
|
||||
<div className="items-center block sm:flex">
|
||||
<div className="mb-4 min-w-48 sm:mb-0">
|
||||
<label htmlFor="slug" className="flex mt-0 text-sm font-medium text-neutral-700">
|
||||
<label htmlFor="slug" className="mt-0 label-form-icon">
|
||||
<LinkIcon className="w-4 h-4 mr-2 text-neutral-500" />
|
||||
URL
|
||||
{t("url")}
|
||||
</label>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
@@ -378,7 +374,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
<MinutesField
|
||||
label={
|
||||
<>
|
||||
<ClockIcon className="w-4 h-4 mr-2 mt-0.5 text-neutral-500" /> Duration
|
||||
<ClockIcon className="w-4 h-4 mr-2 mt-0.5 text-neutral-500" /> {t("duration")}
|
||||
</>
|
||||
}
|
||||
name="length"
|
||||
@@ -394,7 +390,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
<div className="min-w-48 sm:mb-0">
|
||||
<label htmlFor="location" className="flex mt-2.5 text-sm font-medium text-neutral-700">
|
||||
<LocationMarkerIcon className="w-4 h-4 mr-2 mt-0.5 text-neutral-500" />
|
||||
Location
|
||||
{t("location")}
|
||||
</label>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
@@ -427,7 +423,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
{location.type === LocationType.Phone && (
|
||||
<div className="flex items-center flex-grow">
|
||||
<PhoneIcon className="w-6 h-6" />
|
||||
<span className="ml-2 text-sm">Phone call</span>
|
||||
<span className="ml-2 text-sm">{t("phone_call")}</span>
|
||||
</div>
|
||||
)}
|
||||
{location.type === LocationType.GoogleMeet && (
|
||||
@@ -537,11 +533,11 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => openLocationModal(location.type)}
|
||||
className="mr-1 text-gray-500 hover:text-gray-900 p-1">
|
||||
className="p-1 mr-1 text-gray-500 hover:text-gray-900">
|
||||
<PencilIcon className="w-4 h-4" />
|
||||
</button>
|
||||
<button onClick={() => removeLocation(location)}>
|
||||
<XIcon className="w-6 h-6 pl-1 border-l-1 text-gray-500 hover:text-gray-900 " />
|
||||
<XIcon className="w-6 h-6 pl-1 text-gray-500 border-l-1 hover:text-gray-900 " />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -555,7 +551,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
onClick={() => setShowLocationModal(true)}>
|
||||
<PlusIcon className="h-4 w-4 mt-0.5 text-neutral-900" />
|
||||
<span className="ml-1 text-sm font-medium text-neutral-700">
|
||||
Add a location
|
||||
{t("add_location")}
|
||||
</span>
|
||||
</button>
|
||||
</li>
|
||||
@@ -571,7 +567,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
<div className="mb-4 min-w-48 sm:mb-0 mt-2.5">
|
||||
<label htmlFor="description" className="flex mt-0 text-sm font-medium text-neutral-700">
|
||||
<DocumentIcon className="w-4 h-4 mr-2 mt-0.5 text-neutral-500" />
|
||||
Description
|
||||
{t("description")}
|
||||
</label>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
@@ -579,7 +575,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
name="description"
|
||||
id="description"
|
||||
className="block w-full border-gray-300 rounded-sm shadow-sm focus:ring-primary-500 focus:border-primary-500 sm:text-sm"
|
||||
placeholder="A quick video meeting."
|
||||
placeholder={t("quick_video_meeting")}
|
||||
defaultValue={asStringOrUndefined(eventType.description)}></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@@ -592,7 +588,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
<label
|
||||
htmlFor="schedulingType"
|
||||
className="flex mt-2 text-sm font-medium text-neutral-700">
|
||||
<UsersIcon className="w-5 h-5 mr-2 text-neutral-500" /> Scheduling Type
|
||||
<UsersIcon className="w-5 h-5 mr-2 text-neutral-500" /> {t("scheduling_type")}
|
||||
</label>
|
||||
</div>
|
||||
<RadioArea.Select
|
||||
@@ -605,7 +601,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
<div className="block sm:flex">
|
||||
<div className="mb-4 min-w-48 sm:mb-0">
|
||||
<label htmlFor="users" className="flex text-sm font-medium text-neutral-700">
|
||||
<UserAddIcon className="w-5 h-5 mr-2 text-neutral-500" /> Attendees
|
||||
<UserAddIcon className="w-5 h-5 mr-2 text-neutral-500" /> {t("attendees")}
|
||||
</label>
|
||||
</div>
|
||||
<div className="w-full space-y-2">
|
||||
@@ -614,7 +610,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
defaultValue={eventType.users.map(mapUserToValue)}
|
||||
options={teamMembers.map(mapUserToValue)}
|
||||
id="users"
|
||||
placeholder="Add attendees"
|
||||
placeholder={t("add_attendees")}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -628,13 +624,15 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
<ChevronRightIcon
|
||||
className={`${open ? "transform rotate-90" : ""} w-5 h-5 text-neutral-500 ml-auto`}
|
||||
/>
|
||||
<span className="text-sm font-medium text-neutral-700">Show advanced settings</span>
|
||||
<span className="text-sm font-medium text-neutral-700">
|
||||
{t("show_advanced_settings")}
|
||||
</span>
|
||||
</Disclosure.Button>
|
||||
<Disclosure.Panel className="space-y-6">
|
||||
<div className="items-center block sm:flex">
|
||||
<div className="mb-4 min-w-48 sm:mb-0">
|
||||
<label htmlFor="eventName" className="flex text-sm font-medium text-neutral-700">
|
||||
Event name
|
||||
{t("event_name")}
|
||||
</label>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
@@ -645,7 +643,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
name="title"
|
||||
id="title"
|
||||
className="block w-full border-gray-300 rounded-sm shadow-sm focus:ring-primary-500 focus:border-primary-500 sm:text-sm"
|
||||
placeholder="Meeting with {USER}"
|
||||
placeholder={t("meeting_with_user")}
|
||||
defaultValue={eventType.eventName}
|
||||
/>
|
||||
</div>
|
||||
@@ -655,8 +653,8 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
<div className="mb-4 min-w-48 sm:mb-0">
|
||||
<label
|
||||
htmlFor="additionalFields"
|
||||
className="flexflex mt-2 text-sm font-medium text-neutral-700 text-sm font-medium text-neutral-700">
|
||||
Additional inputs
|
||||
className="mt-2 text-sm font-medium flexflex text-neutral-700">
|
||||
{t("additional_inputs")}
|
||||
</label>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
@@ -666,7 +664,9 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
<div className="flex justify-between">
|
||||
<div>
|
||||
<div>
|
||||
<span className="ml-2 text-sm">Label: {customInput.label}</span>
|
||||
<span className="ml-2 text-sm">
|
||||
{t("label")}: {customInput.label}
|
||||
</span>
|
||||
</div>
|
||||
{customInput.placeholder && (
|
||||
<div>
|
||||
@@ -676,7 +676,9 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
<span className="ml-2 text-sm">Type: {customInput.type}</span>
|
||||
<span className="ml-2 text-sm">
|
||||
{t("type")}: {customInput.type}
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span className="ml-2 text-sm">
|
||||
@@ -692,7 +694,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
}}
|
||||
color="minimal"
|
||||
type="button">
|
||||
Edit
|
||||
{t("edit")}
|
||||
</Button>
|
||||
<button type="button" onClick={() => removeCustom(idx)}>
|
||||
<XIcon className="w-6 h-6 pl-1 border-l-2 hover:text-red-500 " />
|
||||
@@ -710,7 +712,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
color="secondary"
|
||||
type="button"
|
||||
StartIcon={PlusIcon}>
|
||||
Add an input
|
||||
{t("add_input")}
|
||||
</Button>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -720,23 +722,23 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
<CheckboxField
|
||||
id="requiresConfirmation"
|
||||
name="requiresConfirmation"
|
||||
label="Opt-in booking"
|
||||
description="The booking needs to be manually confirmed before it is pushed to the integrations and a confirmation mail is sent."
|
||||
label={t("opt_in_booking")}
|
||||
description={t("opt_in_booking_description")}
|
||||
defaultChecked={eventType.requiresConfirmation}
|
||||
/>
|
||||
|
||||
<CheckboxField
|
||||
id="disableGuests"
|
||||
name="disableGuests"
|
||||
label="Disable guests"
|
||||
description="Disable adding aditional guests while booking."
|
||||
label={t("disable_guests")}
|
||||
description={t("disable_guests_description")}
|
||||
defaultChecked={eventType.disableGuests}
|
||||
/>
|
||||
|
||||
<hr className="my-2 border-neutral-200" />
|
||||
|
||||
<MinutesField
|
||||
label="Minimum booking notice"
|
||||
label={t("minimum_booking_notice")}
|
||||
name="minimumBookingNotice"
|
||||
id="minimumBookingNotice"
|
||||
required
|
||||
@@ -749,12 +751,12 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
<label
|
||||
htmlFor="inviteesCanSchedule"
|
||||
className="flex text-sm font-medium text-neutral-700 mt-2.5">
|
||||
Invitees can schedule
|
||||
{t("invitees_can_schedule")}
|
||||
</label>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<RadioGroup value={periodType} onChange={setPeriodType}>
|
||||
<RadioGroup.Label className="sr-only">Date Range</RadioGroup.Label>
|
||||
<RadioGroup.Label className="sr-only">{t("date_range")}</RadioGroup.Label>
|
||||
<div>
|
||||
{PERIOD_TYPES.map((period) => (
|
||||
<RadioGroup.Option
|
||||
@@ -804,8 +806,8 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
defaultValue={
|
||||
eventType.periodCountCalendarDays ? "1" : "0"
|
||||
}>
|
||||
<option value="1">calendar days</option>
|
||||
<option value="0">business days</option>
|
||||
<option value="1">{t("calendar_days")}</option>
|
||||
<option value="0">{t("business_days")}</option>
|
||||
</select>
|
||||
</div>
|
||||
)}
|
||||
@@ -838,7 +840,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
<label
|
||||
htmlFor="availability"
|
||||
className="flex text-sm font-medium text-neutral-700">
|
||||
Availability
|
||||
{t("availability")}
|
||||
</label>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
@@ -859,7 +861,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
<label
|
||||
htmlFor="payment"
|
||||
className="flex mt-2 text-sm font-medium text-neutral-700">
|
||||
Payment
|
||||
{t("payment")}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@@ -880,7 +882,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
</div>
|
||||
<div className="ml-3 text-sm">
|
||||
<p className="text-neutral-900">
|
||||
Require Payment (0.5% +{" "}
|
||||
{t("require_payment")} (0.5% +{" "}
|
||||
<IntlProvider locale="en">
|
||||
<FormattedNumber
|
||||
value={0.1}
|
||||
@@ -888,7 +890,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
currency={currency}
|
||||
/>
|
||||
</IntlProvider>{" "}
|
||||
commission per transaction)
|
||||
{t("commission_per_transaction")})
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -939,14 +941,15 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
</Disclosure>
|
||||
<div className="flex justify-end mt-4 space-x-2">
|
||||
<Button href="/event-types" color="secondary" tabIndex={-1}>
|
||||
Cancel
|
||||
{t("cancel")}
|
||||
</Button>
|
||||
{t("update")}
|
||||
</Button>
|
||||
<Button type="submit">Update</Button>
|
||||
</div>
|
||||
</form>
|
||||
<Modal
|
||||
heading="Event Type updated successfully"
|
||||
description="Your event type has been updated successfully."
|
||||
heading={t("event_type_updated_successfully")}
|
||||
description={t("event_type_updated_successfully_description")}
|
||||
open={successModalOpen}
|
||||
handleClose={closeSuccessModal}
|
||||
/>
|
||||
@@ -958,7 +961,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
name="isHidden"
|
||||
defaultChecked={hidden}
|
||||
onCheckedChange={setHidden}
|
||||
label="Hide event type"
|
||||
label={t("hide_event_type")}
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-4 space-y-1.5">
|
||||
@@ -966,9 +969,9 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
href={permalink}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="flex font-medium text-md text-neutral-700 text-sm items-center hover:text-gray-900 hover:bg-gray-200 px-2 py-1 rounded-sm inline-flex">
|
||||
className="flex inline-flex items-center px-2 py-1 text-sm font-medium rounded-sm text-md text-neutral-700 hover:text-gray-900 hover:bg-gray-200">
|
||||
<ExternalLinkIcon className="w-4 h-4 mr-2 text-neutral-500" aria-hidden="true" />
|
||||
Preview
|
||||
{t("preview")}
|
||||
</a>
|
||||
<button
|
||||
onClick={() => {
|
||||
@@ -976,23 +979,22 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
showToast("Link copied!", "success");
|
||||
}}
|
||||
type="button"
|
||||
className="flex font-medium text-md text-sm text-gray-700 items-center hover:text-gray-900 hover:bg-gray-200 px-2 py-1 rounded-sm">
|
||||
className="flex items-center px-2 py-1 text-sm font-medium text-gray-700 rounded-sm text-md hover:text-gray-900 hover:bg-gray-200">
|
||||
<LinkIcon className="w-4 h-4 mr-2 text-neutral-500" />
|
||||
Copy link
|
||||
{t("copy_link")}
|
||||
</button>
|
||||
<Dialog>
|
||||
<DialogTrigger className="flex font-medium text-md text-sm text-neutral-700 items-center hover:text-gray-900 hover:bg-gray-200 px-2 py-1 rounded-sm">
|
||||
<DialogTrigger className="flex items-center px-2 py-1 text-sm font-medium rounded-sm text-md text-neutral-700 hover:text-gray-900 hover:bg-gray-200">
|
||||
<TrashIcon className="w-4 h-4 mr-2 text-neutral-500" />
|
||||
Delete
|
||||
{t("delete")}
|
||||
</DialogTrigger>
|
||||
<ConfirmationDialogContent
|
||||
localeProp={locale}
|
||||
variety="danger"
|
||||
title="Delete Event Type"
|
||||
confirmBtnText="Yes, delete event type"
|
||||
title={t("delete_event_type")}
|
||||
confirmBtnText={t("confirm_delete_event_type")}
|
||||
onConfirm={deleteEventTypeHandler}>
|
||||
Are you sure you want to delete this event type? Anyone who you've shared this link
|
||||
with will no longer be able to book using it.
|
||||
{t("delete_event_type_description")}
|
||||
</ConfirmationDialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
@@ -1020,7 +1022,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
</div>
|
||||
<div className="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
|
||||
<h3 className="text-lg font-medium leading-6 text-gray-900" id="modal-title">
|
||||
Edit location
|
||||
{t("edit_location")}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1037,10 +1039,10 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
<LocationOptions />
|
||||
<div className="mt-5 sm:mt-4 sm:flex sm:flex-row-reverse">
|
||||
<button type="submit" className="btn btn-primary">
|
||||
Update
|
||||
{t("update")}
|
||||
</button>
|
||||
<button onClick={closeLocationModal} type="button" className="mr-2 btn btn-white">
|
||||
Cancel
|
||||
{t("cancel")}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -1057,39 +1059,39 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||
</div>
|
||||
<div className="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
|
||||
<h3 className="text-lg font-medium leading-6 text-gray-900" id="modal-title">
|
||||
Add new custom input field
|
||||
{t("add_new_custom_input_field")}
|
||||
</h3>
|
||||
<div>
|
||||
<p className="text-sm text-gray-400">This input will be shown when booking this event</p>
|
||||
<p className="text-sm text-gray-400">{t("this_input_will_shown_booking_this_event")}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<CustomInputTypeForm
|
||||
selectedCustomInput={selectedCustomInput}
|
||||
onSubmit={(values) => {
|
||||
const customInput: EventTypeCustomInput = {
|
||||
id: -1,
|
||||
eventTypeId: -1,
|
||||
label: values.label,
|
||||
placeholder: values.placeholder,
|
||||
required: values.required,
|
||||
type: values.type,
|
||||
};
|
||||
<CustomInputTypeForm
|
||||
selectedCustomInput={selectedCustomInput}
|
||||
onSubmit={(values) => {
|
||||
const customInput: EventTypeCustomInput = {
|
||||
id: -1,
|
||||
eventTypeId: -1,
|
||||
label: values.label,
|
||||
placeholder: values.placeholder,
|
||||
required: values.required,
|
||||
type: values.type,
|
||||
};
|
||||
|
||||
if (selectedCustomInput) {
|
||||
selectedCustomInput.label = customInput.label;
|
||||
selectedCustomInput.placeholder = customInput.placeholder;
|
||||
selectedCustomInput.required = customInput.required;
|
||||
selectedCustomInput.type = customInput.type;
|
||||
} else {
|
||||
setCustomInputs(customInputs.concat(customInput));
|
||||
}
|
||||
setSelectedCustomInputModalOpen(false);
|
||||
}}
|
||||
onCancel={() => {
|
||||
setSelectedCustomInputModalOpen(false);
|
||||
}}
|
||||
/>
|
||||
if (selectedCustomInput) {
|
||||
selectedCustomInput.label = customInput.label;
|
||||
selectedCustomInput.placeholder = customInput.placeholder;
|
||||
selectedCustomInput.required = customInput.required;
|
||||
selectedCustomInput.type = customInput.type;
|
||||
} else {
|
||||
setCustomInputs(customInputs.concat(customInput));
|
||||
}
|
||||
setSelectedCustomInputModalOpen(false);
|
||||
}}
|
||||
onCancel={() => {
|
||||
setSelectedCustomInputModalOpen(false);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
@@ -1244,7 +1246,6 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
|
||||
if (hasDailyIntegration) {
|
||||
locationOptions.push({ value: LocationType.Daily, label: "Daily.co Video" });
|
||||
}
|
||||
|
||||
const currency =
|
||||
(credentials.find((integration) => integration.type === "stripe_payment")?.key as unknown as StripeData)
|
||||
?.default_currency || "usd";
|
||||
|
||||
+31
-33
@@ -55,17 +55,14 @@ type Profile = PageProps["profiles"][number];
|
||||
type MembershipCount = EventType["metadata"]["membershipCount"];
|
||||
|
||||
const EventTypesPage = (props: PageProps) => {
|
||||
const { locale } = useLocale({ localeProp: props.localeProp });
|
||||
const { t, locale } = useLocale({ localeProp: props.localeProp });
|
||||
|
||||
const CreateFirstEventTypeView = () => (
|
||||
<div className="md:py-20">
|
||||
<UserCalendarIllustration />
|
||||
<div className="block mx-auto text-center md:max-w-screen-sm">
|
||||
<h3 className="mt-2 text-xl font-bold text-neutral-900">Create your first event type</h3>
|
||||
<p className="mt-1 mb-2 text-md text-neutral-600">
|
||||
Event types enable you to share links that show available times on your calendar and allow people to
|
||||
make bookings with you.
|
||||
</p>
|
||||
<h3 className="mt-2 text-xl font-bold text-neutral-900">{t("new_event_type_heading")}</h3>
|
||||
<p className="mt-1 mb-2 text-md text-neutral-600">{t("new_event_type_description")}</p>
|
||||
<CreateNewEventDialog
|
||||
localeProp={locale}
|
||||
canAddEvents={props.canAddEvents}
|
||||
@@ -151,12 +148,12 @@ const EventTypesPage = (props: PageProps) => {
|
||||
<span className="font-medium truncate text-neutral-900">{type.title}</span>
|
||||
{type.hidden && (
|
||||
<span className="ml-2 inline items-center px-1.5 py-0.5 rounded-sm text-xs font-medium bg-yellow-100 text-yellow-800">
|
||||
Hidden
|
||||
{t("hidden")}
|
||||
</span>
|
||||
)}
|
||||
{readOnly && (
|
||||
<span className="ml-2 inline items-center px-1.5 py-0.5 rounded-sm text-xs font-medium bg-gray-100 text-gray-800">
|
||||
Readonly
|
||||
{t("readonly")}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
@@ -207,7 +204,7 @@ const EventTypesPage = (props: PageProps) => {
|
||||
<>
|
||||
<div>
|
||||
<Menu.Button className="p-2 mt-1 border border-transparent text-neutral-400 hover:border-gray-200">
|
||||
<span className="sr-only">Open options</span>
|
||||
<span className="sr-only">{t("open_options")}</span>
|
||||
<DotsHorizontalIcon className="w-5 h-5" aria-hidden="true" />
|
||||
</Menu.Button>
|
||||
</div>
|
||||
@@ -239,7 +236,7 @@ const EventTypesPage = (props: PageProps) => {
|
||||
className="w-4 h-4 mr-3 text-neutral-400 group-hover:text-neutral-500"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
Preview
|
||||
{t("preview")}
|
||||
</a>
|
||||
)}
|
||||
</Menu.Item>
|
||||
@@ -260,7 +257,7 @@ const EventTypesPage = (props: PageProps) => {
|
||||
className="w-4 h-4 mr-3 text-neutral-400 group-hover:text-neutral-500"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
Copy link to event
|
||||
{t("copy_link")}
|
||||
</button>
|
||||
)}
|
||||
</Menu.Item>
|
||||
@@ -281,12 +278,12 @@ const EventTypesPage = (props: PageProps) => {
|
||||
return (
|
||||
<div>
|
||||
<Head>
|
||||
<title>Event Types | Cal.com</title>
|
||||
<title>{t("event_types_page_title")}| Cal.com</title>
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
</Head>
|
||||
<Shell
|
||||
heading="Event Types"
|
||||
subtitle="Create events to share for people to book on your calendar."
|
||||
heading={t("event_types_page_title")}
|
||||
subtitle={t("event_types_page_subtitle")}
|
||||
CTA={
|
||||
props.eventTypes.length !== 0 && (
|
||||
<CreateNewEventDialog canAddEvents={props.canAddEvents} profiles={props.profiles} />
|
||||
@@ -295,10 +292,10 @@ const EventTypesPage = (props: PageProps) => {
|
||||
{props.user.plan === "FREE" && !props.canAddEvents && (
|
||||
<Alert
|
||||
severity="warning"
|
||||
title={<>You need to upgrade your plan to have more than one active event type.</>}
|
||||
title={<>{t("plan_upgrade")}</>}
|
||||
message={
|
||||
<>
|
||||
To upgrade go to{" "}
|
||||
{t("to_upgrade_go_to")}{" "}
|
||||
<a href={"https://cal.com/upgrade"} className="underline">
|
||||
{"https://cal.com/upgrade"}
|
||||
</a>
|
||||
@@ -384,7 +381,7 @@ const CreateNewEventDialog = ({
|
||||
<Button EndIcon={ChevronDownIcon}>{t("new_event_type_btn")}</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
<DropdownMenuLabel>Create an event type under your name or a team.</DropdownMenuLabel>
|
||||
<DropdownMenuLabel>{t("new_event_subtitle")}</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator className="h-px bg-gray-200" />
|
||||
{profiles.map((profile) => (
|
||||
<DropdownMenuItem
|
||||
@@ -420,10 +417,10 @@ const CreateNewEventDialog = ({
|
||||
<DialogContent>
|
||||
<div className="mb-8">
|
||||
<h3 className="text-lg font-bold leading-6 text-gray-900" id="modal-title">
|
||||
Add a new {teamId ? "team " : ""}event type
|
||||
{teamId ? t("add_new_team_event_type") : t("add_new_event_type")}
|
||||
</h3>
|
||||
<div>
|
||||
<p className="text-sm text-gray-500">Create a new event type for people to book times with.</p>
|
||||
<p className="text-sm text-gray-500">{t("new_event_type_to_book_description")}</p>
|
||||
</div>
|
||||
</div>
|
||||
<form
|
||||
@@ -452,7 +449,7 @@ const CreateNewEventDialog = ({
|
||||
<div>
|
||||
<div className="mb-4">
|
||||
<label htmlFor="title" className="block text-sm font-medium text-gray-700">
|
||||
Title
|
||||
{t("title")}
|
||||
</label>
|
||||
<div className="mt-1">
|
||||
<input
|
||||
@@ -467,17 +464,18 @@ const CreateNewEventDialog = ({
|
||||
id="title"
|
||||
required
|
||||
className="block w-full border-gray-300 rounded-sm shadow-sm focus:ring-neutral-900 focus:border-neutral-900 sm:text-sm"
|
||||
placeholder="Quick Chat"
|
||||
placeholder={t("quick_chat")}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mb-4">
|
||||
<label htmlFor="slug" className="block text-sm font-medium text-gray-700">
|
||||
URL
|
||||
{t("url")}
|
||||
</label>
|
||||
<div className="mt-1">
|
||||
<div className="flex rounded-sm shadow-sm">
|
||||
<span className="inline-flex items-center px-3 text-gray-500 border border-r-0 border-gray-300 rounded-l-md bg-gray-50 sm:text-sm">
|
||||
<span className="input-left">
|
||||
{process.env.NEXT_PUBLIC_APP_URL}/{router.query.eventPage || profiles[0].slug}/
|
||||
</span>
|
||||
<input
|
||||
@@ -493,20 +491,20 @@ const CreateNewEventDialog = ({
|
||||
</div>
|
||||
<div className="mb-4">
|
||||
<label htmlFor="description" className="block text-sm font-medium text-gray-700">
|
||||
Description
|
||||
{t("description")}
|
||||
</label>
|
||||
<div className="mt-1">
|
||||
<textarea
|
||||
name="description"
|
||||
id="description"
|
||||
className="block w-full border-gray-300 rounded-sm shadow-sm focus:ring-neutral-900 focus:border-neutral-900 sm:text-sm"
|
||||
placeholder="A quick video meeting."
|
||||
placeholder={t("quick_video_meeting")}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mb-4">
|
||||
<label htmlFor="length" className="block text-sm font-medium text-gray-700">
|
||||
Length
|
||||
{t("length")}
|
||||
</label>
|
||||
<div className="relative mt-1 rounded-sm shadow-sm">
|
||||
<input
|
||||
@@ -519,7 +517,7 @@ const CreateNewEventDialog = ({
|
||||
defaultValue={15}
|
||||
/>
|
||||
<div className="absolute inset-y-0 right-0 flex items-center pr-3 text-sm text-gray-400">
|
||||
minutes
|
||||
{t("minutes")}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -527,28 +525,28 @@ const CreateNewEventDialog = ({
|
||||
{teamId && (
|
||||
<div className="mb-4">
|
||||
<label htmlFor="schedulingType" className="block text-sm font-medium text-gray-700">
|
||||
Scheduling Type
|
||||
{t("scheduling_type")}
|
||||
</label>
|
||||
<RadioArea.Group
|
||||
name="schedulingType"
|
||||
className="relative flex mt-1 space-x-6 rounded-sm shadow-sm">
|
||||
<RadioArea.Item value={SchedulingType.COLLECTIVE} className="w-1/2 text-sm">
|
||||
<strong className="block mb-1">Collective</strong>
|
||||
<p>Schedule meetings when all selected team members are available.</p>
|
||||
<strong className="block mb-1">{t("collective")}</strong>
|
||||
<p>{t("collective_description")}</p>
|
||||
</RadioArea.Item>
|
||||
<RadioArea.Item value={SchedulingType.ROUND_ROBIN} className="w-1/2 text-sm">
|
||||
<strong className="block mb-1">Round Robin</strong>
|
||||
<p>Cycle meetings between multiple team members.</p>
|
||||
<strong className="block mb-1">{t("round_robin")}</strong>
|
||||
<p>{t("round_robin_description")}</p>
|
||||
</RadioArea.Item>
|
||||
</RadioArea.Group>
|
||||
</div>
|
||||
)}
|
||||
<div className="mt-8 sm:flex sm:flex-row-reverse gap-x-2">
|
||||
<Button type="submit" loading={createMutation.isLoading}>
|
||||
Continue
|
||||
{t("continue")}
|
||||
</Button>
|
||||
<DialogClose asChild>
|
||||
<Button color="secondary">Cancel</Button>
|
||||
<Button color="secondary">{t("cancel")}</Button>
|
||||
</DialogClose>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Reference in new issue
Block a user