-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Timezone in Email Embed not working #15525 #15537
base: main
Are you sure you want to change the base?
Changes from 3 commits
90fb7e2
43f73d2
954c0ca
143ec1c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -299,7 +299,7 @@ const EmailEmbed = ({ | |
<Collapsible open> | ||
<CollapsibleContent> | ||
<div className="text-default mb-[9px] text-sm">{t("timezone")}</div> | ||
<TimezoneSelect id="timezone" value={timezone} isDisabled /> | ||
<TimezoneSelect id="timezone" value={timezone} isDisabled={false} /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hariombalhara was this disabled on purpose? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Pradumn27 worked on this feature. I believe there has to be a reason. It isn't accidental. |
||
</CollapsibleContent> | ||
</Collapsible> | ||
</div> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ import { useMemo, useState } from "react"; | |
import type { ITimezoneOption, ITimezone, Props as SelectProps } from "react-timezone-select"; | ||
import BaseSelect from "react-timezone-select"; | ||
|
||
import { useTimePreferences } from "@calcom/features/bookings/lib/timePreferences"; | ||
import { classNames } from "@calcom/lib"; | ||
import { filterByCities, addCitiesToDropdown, handleOptionLabel } from "@calcom/lib/timezone"; | ||
import { trpc } from "@calcom/trpc/react"; | ||
|
@@ -42,6 +43,7 @@ export function TimezoneSelectComponent({ | |
value, | ||
...props | ||
}: TimezoneSelectComponentProps) { | ||
const [setTimezone] = useTimePreferences((state) => [state.setTimezone]); | ||
const [cities, setCities] = useState<ICity[]>([]); | ||
const handleInputChange = (tz: string) => { | ||
if (data) setCities(filterByCities(tz, data)); | ||
|
@@ -64,6 +66,7 @@ export function TimezoneSelectComponent({ | |
...(data ? addCitiesToDropdown(data) : {}), | ||
...addCitiesToDropdown(cities), | ||
}} | ||
onChange={({ value }) => setTimezone(value)} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aren't |
||
onInputChange={handleInputChange} | ||
{...props} | ||
formatOptionLabel={(option) => ( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@acharyayush how about toggling the value of the prop
isDisabled
?<TimezoneSelect id="timezone" value={timezone} isDisabled={false} />