Skip to content

Commit 60a4d3f

Browse files
authored
feat(companion): Add DropdownMenu and Alert Dialog for Android (calcom#26385)
* feat(companion): add DropdownMenu for Android event types list Replace Alert.alert with react-native-reusables DropdownMenu component for Android event type list items, providing a native-feeling menu experience that matches iOS functionality. Changes: - Install react-native-reusables dropdown-menu component and dependencies (lucide-react-native, tailwindcss-animate, class-variance-authority, clsx, tailwind-merge) - Create EventTypeListItem.android.tsx with DropdownMenu implementation - Single ellipsis button triggers dropdown menu - Menu includes: Preview, Copy link, Edit, Duplicate, Delete - Delete action marked as destructive variant - Proper safe area insets handling - Add PortalHost to app/_layout.tsx for portal rendering support - Create lib/utils.ts with cn() helper for className merging - Update global.css with theme CSS variables (popover, border, accent, destructive, etc.) for dropdown menu styling - Update tailwind.config.js with theme colors and tailwindcss-animate plugin - Update metro.config.js with inlineRem: 16 for proper rem unit handling - Remove Android Alert.alert fallback from event types index.tsx - Fix lint issues in generated dropdown-menu.tsx (remove unnecessary fragments) The Android experience now matches iOS with a single menu button that opens a dropdown containing all event type actions, replacing the previous Alert.alert dialog and separate action buttons. Refs: https://reactnativereusables.com/docs/components/dropdown-menu * adjust with of menu * feat(companion): add DropdownMenu for Android booking and availability list items - Add BookingListItem.android.tsx with DropdownMenu for booking actions - Add BookingDetailScreen.android.tsx with DropdownMenu in header - Add AvailabilityListItem.android.tsx with DropdownMenu for schedule actions Actions include: Reschedule, Edit Location, Add Guests, View Recordings, Meeting Session Details, Mark as No-Show, Report Booking, Cancel Event for bookings; Set as Default, Duplicate, Delete for availability schedules. * fix lint issues * feat(android): replace native alerts with AlertDialog and Toast in event types - Install AlertDialog and Alert components from react-native-reusables - Create Android-specific event types screen (index.android.tsx) - Replace native Alert.alert() with AlertDialog for delete confirmation - Add inline validation errors (red border + error text) in create modal - Implement Toast snackbar for success/error notifications (no layout shift) - Auto-dismiss toast after 2.5 seconds - Fix React Compiler compatibility by removing animated refs This provides a more consistent and polished UI experience on Android, matching the design system used in other parts of the app. * feat(android): add AlertDialog for availability delete and booking cancel - Add index.android.tsx for availability with AlertDialog for delete confirmation - Add index.android.tsx for bookings with AlertDialog for cancel (with reason input) - Both screens include Toast snackbar for success/error notifications - Follows the same pattern as event types Android implementation * feat(companion): add DropdownMenu and AlertDialog for Android - Replace native Alert.alert context menus with DropdownMenu component for event types, bookings, and availability lists - Replace FullScreenModal with AlertDialog for create/delete/cancel flows - Add toast notifications for success/error feedback on Android - Set consistent 380px max-width for all AlertDialogs - Fix layout headers showing "index" text on event-types and availability - Create Android-specific More screen with AlertDialog logout confirmation Uses react-native-reusables components for polished Android UI * better code * fix cubics comments * refactor(android): revert delete confirmations to native Alert.alert() - Logout: reverted to native Alert.alert() (simple yes/no) - Event Types Delete: reverted to native Alert.alert() (simple yes/no) - Availability Delete: reverted to native Alert.alert() (simple yes/no) Keep AlertDialog only where user input is needed: - Event Types Create (has TextInput for title) - Availability Create (has TextInput for name) - Bookings Cancel (has TextInput for cancellation reason) * refactor(android): remove redundant index.android.tsx files The main index.tsx files already handle Android via Platform.OS checks. Android-specific behavior for actions is in the list item components: - EventTypeListItem.android.tsx - BookingListItem.android.tsx - AvailabilityListItem.android.tsx This consolidates the code and reduces duplication. * corrected the implementation both native and alert dialog * address cubics comments * fix lint issue and address cubic comments
1 parent c58e0ca commit 60a4d3f

35 files changed

Lines changed: 3153 additions & 156 deletions
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Stack } from "expo-router";
22

3-
export default function EventTypesLayout() {
3+
export default function AvailabilityLayout() {
44
return (
55
<Stack>
6-
<Stack.Screen name="index" options={{}} />
6+
<Stack.Screen name="index" options={{ headerShown: false }} />
77
</Stack>
88
);
99
}

companion/app/(tabs)/(availability)/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { isLiquidGlassAvailable } from "expo-glass-effect";
2+
import { Image } from "expo-image";
23
import { Stack, useRouter } from "expo-router";
34
import { useState } from "react";
45
import { Alert, Platform, Pressable } from "react-native";
@@ -7,7 +8,6 @@ import { useCreateSchedule, useUserProfile } from "@/hooks";
78
import { CalComAPIService } from "@/services/calcom";
89
import { showErrorAlert } from "@/utils/alerts";
910
import { getAvatarUrl } from "@/utils/getAvatarUrl";
10-
import { Image } from "expo-image";
1111

1212
export default function Availability() {
1313
const router = useRouter();

companion/app/(tabs)/(event-types)/_layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Stack } from "expo-router";
33
export default function EventTypesLayout() {
44
return (
55
<Stack>
6-
<Stack.Screen name="index" options={{}} />
6+
<Stack.Screen name="index" options={{ headerShown: false }} />
77
</Stack>
88
);
99
}

companion/app/(tabs)/(event-types)/index.ios.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { buttonStyle, frame, padding } from "@expo/ui/swift-ui/modifiers";
33
import { Ionicons } from "@expo/vector-icons";
44
import * as Clipboard from "expo-clipboard";
55
import { isLiquidGlassAvailable } from "expo-glass-effect";
6+
import { Image } from "expo-image";
67
import { Stack, useRouter } from "expo-router";
78
import { useMemo, useState } from "react";
89
import {
@@ -29,12 +30,11 @@ import {
2930
import { CalComAPIService, type EventType } from "@/services/calcom";
3031
import { showErrorAlert } from "@/utils/alerts";
3132
import { openInAppBrowser } from "@/utils/browser";
33+
import { getAvatarUrl } from "@/utils/getAvatarUrl";
3234
import { getEventDuration } from "@/utils/getEventDuration";
3335
import { offlineAwareRefresh } from "@/utils/network";
3436
import { normalizeMarkdown } from "@/utils/normalizeMarkdown";
3537
import { slugify } from "@/utils/slugify";
36-
import { Image } from "expo-image";
37-
import { getAvatarUrl } from "@/utils/getAvatarUrl";
3838

3939
export default function EventTypesIOS() {
4040
const router = useRouter();

0 commit comments

Comments
 (0)