From 5eacd6b8076df2d838e710ac900cec7e78f54e5d Mon Sep 17 00:00:00 2001 From: Beto <43630417+betomoedano@users.noreply.github.com> Date: Sun, 11 Jan 2026 11:11:32 -0600 Subject: [PATCH] refactor(companion)(ios): Improve header right button in booking details screen (#26721) * refactor: improve code formatting and readability in BookingDetailScreen and Bookings components * refactor: enhance code structure and readability in EventTypesIOS component --- .../(tabs)/(bookings)/booking-detail.ios.tsx | 26 ++++++------ .../app/(tabs)/(event-types)/index.ios.tsx | 40 ++++++++++--------- .../screens/BookingDetailScreen.ios.tsx | 11 ++--- 3 files changed, 39 insertions(+), 38 deletions(-) diff --git a/companion/app/(tabs)/(bookings)/booking-detail.ios.tsx b/companion/app/(tabs)/(bookings)/booking-detail.ios.tsx index d36ae2feaa..96de100eee 100644 --- a/companion/app/(tabs)/(bookings)/booking-detail.ios.tsx +++ b/companion/app/(tabs)/(bookings)/booking-detail.ios.tsx @@ -8,6 +8,7 @@ import type { Booking } from "@/services/calcom"; import { showErrorAlert, showInfoAlert, showSuccessAlert } from "@/utils/alerts"; import { type BookingActionsResult, getBookingActions } from "@/utils/booking-actions"; import { openInAppBrowser } from "@/utils/browser"; +import { isLiquidGlassAvailable } from "expo-glass-effect"; // Empty actions result for when no booking is loaded const EMPTY_ACTIONS: BookingActionsResult = { @@ -225,25 +226,16 @@ export default function BookingDetailIOS() { headerBackTitle: monthName, // This shows on the back button headerBackButtonDisplayMode: "default", headerTitle: "", // Hide the title in the header bar itself - headerStyle: { - backgroundColor: "#f2f2f7", - }, headerShadowVisible: false, + headerTransparent: true, }} /> - + - {/* Join Meeting Menu - only show if there's a meeting URL */} - {meetingUrl && ( - - - - Join Meeting - - - )} - {/* Actions Menu */} @@ -301,6 +293,12 @@ export default function BookingDetailIOS() { ))} + + {meetingUrl && ( + + Join + + )} diff --git a/companion/app/(tabs)/(event-types)/index.ios.tsx b/companion/app/(tabs)/(event-types)/index.ios.tsx index cfffbcf50d..8c9898b7ac 100644 --- a/companion/app/(tabs)/(event-types)/index.ios.tsx +++ b/companion/app/(tabs)/(event-types)/index.ios.tsx @@ -1,5 +1,6 @@ import { Button, ContextMenu, Host, HStack, Image as SwiftUIImage } from "@expo/ui/swift-ui"; -import { buttonStyle, frame, padding } from "@expo/ui/swift-ui/modifiers"; +import * as Haptics from "expo-haptics"; +import { buttonStyle, controlSize, fixedSize, frame, padding } from "@expo/ui/swift-ui/modifiers"; import { Ionicons } from "@expo/vector-icons"; import * as Clipboard from "expo-clipboard"; import { isLiquidGlassAvailable } from "expo-glass-effect"; @@ -168,7 +169,10 @@ export default function EventTypesIOS() { console.error("Failed to delete event type", message); if (__DEV__) { const stack = deleteError instanceof Error ? deleteError.stack : undefined; - console.debug("[EventTypes] deleteEventType failed", { message, stack }); + console.debug("[EventTypes] deleteEventType failed", { + message, + stack, + }); } showErrorAlert("Error", "Failed to delete event type. Please try again."); }, @@ -233,6 +237,7 @@ export default function EventTypesIOS() { }; const handleOpenCreateModal = () => { + Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); // Use native iOS Alert.prompt for a native look Alert.prompt( "Add a new event type", @@ -539,24 +544,21 @@ export default function EventTypesIOS() { {/* Floating Action Button for New Event Type with Glass UI Menu */} - - - diff --git a/companion/components/screens/BookingDetailScreen.ios.tsx b/companion/components/screens/BookingDetailScreen.ios.tsx index bff3d66043..1fa2bd9c43 100644 --- a/companion/components/screens/BookingDetailScreen.ios.tsx +++ b/companion/components/screens/BookingDetailScreen.ios.tsx @@ -327,12 +327,11 @@ export function BookingDetailScreen({ }; return ( - + <> Cancelled by {booking.cancelledByEmail} @@ -675,6 +676,6 @@ export function BookingDetailScreen({ )} - + ); }