diff --git a/components/PlatformDropdown.tsx b/components/PlatformDropdown.tsx index 24fd135c7..ec664a167 100644 --- a/components/PlatformDropdown.tsx +++ b/components/PlatformDropdown.tsx @@ -1,4 +1,4 @@ -import { Button, ContextMenu, Host, Picker } from "@expo/ui/swift-ui"; +import { Button, ContextMenu, Host } from "@expo/ui/swift-ui"; import { Ionicons } from "@expo/vector-icons"; import { BottomSheetScrollView } from "@gorhom/bottom-sheet"; import React, { useEffect } from "react"; @@ -254,23 +254,39 @@ const PlatformDropdownComponent = ({ // Otherwise render as individual buttons if (radioOptions.length > 0) { if (group.title) { - // Use Picker for grouped options + // Use a nested ContextMenu as a submenu for grouped options + const selectedOption = radioOptions.find( + (opt) => opt.selected, + ); + const displayTitle = selectedOption + ? `${group.title}: ${selectedOption.label}` + : group.title; + items.push( - opt.label)} - variant='menu' - selectedIndex={radioOptions.findIndex( - (opt) => opt.selected, - )} - onOptionSelected={(event: any) => { - const index = event.nativeEvent.index; - const selectedOption = radioOptions[index]; - selectedOption?.onPress(); - onOptionSelect?.(selectedOption?.value); - }} - />, + + + + + + {radioOptions.map((option, optionIndex) => ( + + ))} + + , ); } else { // Render radio options as direct buttons diff --git a/components/search/DiscoverFilters.tsx b/components/search/DiscoverFilters.tsx index 2e844c881..b4cf35df0 100644 --- a/components/search/DiscoverFilters.tsx +++ b/components/search/DiscoverFilters.tsx @@ -1,4 +1,4 @@ -import { Button, ContextMenu, Host, Picker } from "@expo/ui/swift-ui"; +import { Button, ContextMenu, Host } from "@expo/ui/swift-ui"; import { Platform, View } from "react-native"; import { FilterButton } from "@/components/filters/FilterButton"; import { JellyseerrSearchSort } from "@/components/jellyseerr/JellyseerrIndexPage"; @@ -49,32 +49,66 @@ export const DiscoverFilters: React.FC = ({ > - - t(`home.settings.plugins.jellyseerr.order_by.${item}`), - )} - variant='menu' - selectedIndex={sortOptions.indexOf( - jellyseerrOrderBy as unknown as string, - )} - onOptionSelected={(event: any) => { - const index = event.nativeEvent.index; - setJellyseerrOrderBy( - sortOptions[index] as unknown as JellyseerrSearchSort, - ); - }} - /> - t(`library.filters.${item}`))} - variant='menu' - selectedIndex={orderOptions.indexOf(jellyseerrSortOrder)} - onOptionSelected={(event: any) => { - const index = event.nativeEvent.index; - setJellyseerrSortOrder(orderOptions[index]); - }} - /> + + + + + + {sortOptions.map((item) => { + const label = t( + `home.settings.plugins.jellyseerr.order_by.${item}`, + ); + const isSelected = + jellyseerrOrderBy === + (item as unknown as JellyseerrSearchSort); + return ( + + ); + })} + + + + + + + + {orderOptions.map((item) => { + const label = t(`library.filters.${item}`); + const isSelected = jellyseerrSortOrder === item; + return ( + + ); + })} + +