-
Notifications
You must be signed in to change notification settings - Fork 0
fix(companion): event type links for org user #70
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
base: copilot_combined_20260121_qodo_grep_cursor_copilot_1_base_fixcompanion_event_type_links_for_org_user_pr706
Are you sure you want to change the base?
Changes from all commits
a92077c
cdfe735
102ed08
2b19bab
a3416cd
a0a15e1
4f49041
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 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -177,6 +177,7 @@ export default function EventTypeDetail() { | |||||||||||||||||||||||||||||
| const [conferencingOptions, setConferencingOptions] = useState<ConferencingOption[]>([]); | ||||||||||||||||||||||||||||||
| const [conferencingLoading, setConferencingLoading] = useState(false); | ||||||||||||||||||||||||||||||
| const [eventTypeData, setEventTypeData] = useState<EventType | null>(null); | ||||||||||||||||||||||||||||||
| const [bookingUrl, setBookingUrl] = useState<string>(""); | ||||||||||||||||||||||||||||||
| const [saving, setSaving] = useState(false); | ||||||||||||||||||||||||||||||
| const [beforeEventBuffer, setBeforeEventBuffer] = useState("No buffer time"); | ||||||||||||||||||||||||||||||
|
Comment on lines
179
to
182
|
||||||||||||||||||||||||||||||
| const [eventTypeData, setEventTypeData] = useState<EventType | null>(null); | |
| const [bookingUrl, setBookingUrl] = useState<string>(""); | |
| const [saving, setSaving] = useState(false); | |
| const [beforeEventBuffer, setBeforeEventBuffer] = useState("No buffer time"); | |
| const [eventTypeData, setEventTypeData] = useState<(EventType & { bookingUrl?: string }) | null>(null); | |
| const [bookingUrl, setBookingUrl] = useState<string>(""); | |
| const [saving, setSaving] = useState(false); | |
| const [beforeEventBuffer, setBeforeEventBuffer] = useState("No buffer time"); | |
| useEffect(() => { | |
| if (eventTypeData?.bookingUrl) { | |
| setBookingUrl(eventTypeData.bookingUrl); | |
| } | |
| }, [eventTypeData]); |
Copilot
AI
Jan 21, 2026
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.
The style prop duplicates the flexDirection and alignItems properties that are already set in the className. The className already includes "flex-row items-center", which applies these same styles. This duplication is redundant and could lead to confusion.
| <AppPressable | |
| className="flex-row items-center gap-1 px-2 py-2" | |
| style={{ flexDirection: "row", alignItems: "center" }} | |
| > | |
| <AppPressable className="flex-row items-center gap-1 px-2 py-2"> |
Copilot
AI
Jan 21, 2026
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.
The style prop duplicates the flexDirection and alignItems properties that are already set in the className. The className already includes "flex-row items-center", which applies these same styles. This duplication is redundant and could lead to confusion.
| style={{ height: 44, flexDirection: "row", alignItems: "center" }} | |
| style={{ height: 44 }} |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -37,7 +37,7 @@ import { | |||
| useEventTypes, | ||||
| } from "@/hooks"; | ||||
| import { useEventTypeFilter } from "@/hooks/useEventTypeFilter"; | ||||
| import { CalComAPIService, type EventType } from "@/services/calcom"; | ||||
| import type { EventType } from "@/services/calcom"; | ||||
| import { showErrorAlert, showSuccessAlert } from "@/utils/alerts"; | ||||
| import { openInAppBrowser } from "@/utils/browser"; | ||||
| import { getEventDuration } from "@/utils/getEventDuration"; | ||||
|
|
@@ -133,22 +133,27 @@ export default function EventTypes() { | |||
| }; | ||||
|
|
||||
| const handleCopyLink = async (eventType: EventType) => { | ||||
| if (!eventType.bookingUrl) { | ||||
| showErrorAlert("Error", "Booking URL not available for this event type."); | ||||
| return; | ||||
| } | ||||
| try { | ||||
| const link = await CalComAPIService.buildEventTypeLink(eventType.slug); | ||||
| await Clipboard.setStringAsync(link); | ||||
|
|
||||
| await Clipboard.setStringAsync(eventType.bookingUrl); | ||||
| showSuccessAlert("Link Copied", "Event type link copied!"); | ||||
| } catch { | ||||
| showErrorAlert("Error", "Failed to copy link. Please try again."); | ||||
| } | ||||
| }; | ||||
|
|
||||
| const _handleShare = async (eventType: EventType) => { | ||||
| if (!eventType.bookingUrl) { | ||||
| showErrorAlert("Error", "Booking URL not available for this event type."); | ||||
| return; | ||||
| } | ||||
| try { | ||||
| const link = await CalComAPIService.buildEventTypeLink(eventType.slug); | ||||
| await Share.share({ | ||||
| message: `Book a meeting: ${eventType.title}`, | ||||
| url: link, | ||||
| url: eventType.bookingUrl, | ||||
| }); | ||||
| } catch { | ||||
| showErrorAlert("Error", "Failed to share link. Please try again."); | ||||
|
|
@@ -280,14 +285,15 @@ export default function EventTypes() { | |||
| }; | ||||
|
|
||||
| const handlePreview = async (eventType: EventType) => { | ||||
| if (!eventType.bookingUrl) { | ||||
| showErrorAlert("Error", "Booking URL not available for this event type."); | ||||
| return; | ||||
| } | ||||
| try { | ||||
| const link = await CalComAPIService.buildEventTypeLink(eventType.slug); | ||||
| // Open in browser | ||||
| if (Platform.OS === "web") { | ||||
| window.open(link, "_blank"); | ||||
| window.open(eventType.bookingUrl, "_blank"); | ||||
| } else { | ||||
| // For mobile, use in-app browser | ||||
| await openInAppBrowser(link, "event type preview"); | ||||
| await openInAppBrowser(eventType.bookingUrl, "event type preview"); | ||||
| } | ||||
| } catch { | ||||
| console.error("Failed to open preview"); | ||||
|
|
@@ -443,6 +449,7 @@ export default function EventTypes() { | |||
| /> | ||||
| <TouchableOpacity | ||||
| className="min-w-[60px] flex-row items-center justify-center gap-1 rounded-lg bg-black px-2.5 py-2" | ||||
| style={{ flexDirection: "row", alignItems: "center", justifyContent: "center" }} | ||||
|
||||
| style={{ flexDirection: "row", alignItems: "center", justifyContent: "center" }} |
Copilot
AI
Jan 21, 2026
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.
The style prop duplicates the flexDirection, alignItems, and justifyContent properties that are already set in the className. The className already includes "flex-row items-center justify-center", which applies these same styles. This duplication is redundant and could lead to confusion.
| style={{ flexDirection: "row", alignItems: "center", justifyContent: "center" }} |
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.
The style prop duplicates the flexDirection and alignItems properties that are already set in the className. The className already includes "flex-row items-center", which applies these same styles. This duplication is redundant and could lead to confusion.