diff --git a/src/screens/MetadataScreen.tsx b/src/screens/MetadataScreen.tsx index 0a92ff06..86750d83 100644 --- a/src/screens/MetadataScreen.tsx +++ b/src/screens/MetadataScreen.tsx @@ -20,7 +20,9 @@ import { useRoute, useNavigation, useFocusEffect } from '@react-navigation/nativ import { MaterialIcons } from '@expo/vector-icons'; import { LinearGradient } from 'expo-linear-gradient'; import { Image } from 'expo-image'; -import { BlurView } from 'expo-blur'; +import { BlurView as ExpoBlurView } from 'expo-blur'; +import { BlurView as CommunityBlurView } from '@react-native-community/blur'; +import * as Haptics from 'expo-haptics'; import { colors } from '../styles/colors'; import { useMetadata } from '../hooks/useMetadata'; import { CastSection as OriginalCastSection } from '../components/metadata/CastSection'; @@ -103,54 +105,62 @@ const ActionButtons = React.memo(({ navigation: NavigationProp; playButtonText: string; animatedStyle: any; -}) => ( - - - - - {playButtonText} - - +}) => { + // Add wrapper for play button with haptic feedback + const handlePlay = () => { + Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium); + handleShowStreams(); + }; - - - - {inLibrary ? 'Saved' : 'Save'} - - - - {type === 'series' && ( + return ( + { - const tmdb = TMDBService.getInstance(); - const tmdbId = await tmdb.extractTMDBIdFromStremioId(id); - if (tmdbId) { - navigation.navigate('ShowRatings', { showId: tmdbId }); - } else { - logger.error('Could not find TMDB ID for show'); - } - }} + style={[styles.actionButton, styles.playButton]} + onPress={handlePlay} > - + + + {playButtonText} + - )} - -)); + + + + + {inLibrary ? 'Saved' : 'Save'} + + + + {type === 'series' && ( + { + const tmdb = TMDBService.getInstance(); + const tmdbId = await tmdb.extractTMDBIdFromStremioId(id); + if (tmdbId) { + navigation.navigate('ShowRatings', { showId: tmdbId }); + } else { + logger.error('Could not find TMDB ID for show'); + } + }} + > + + + )} + + ); +}); // Memoized WatchProgress Component const WatchProgressDisplay = React.memo(({ @@ -254,6 +264,21 @@ const MetadataScreen = () => { episodeId?: string; } | null>(null); + // Add wrapper for toggleLibrary that includes haptic feedback + const handleToggleLibrary = useCallback(() => { + // Trigger appropriate haptic feedback based on action + if (inLibrary) { + // Removed from library - light impact + Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); + } else { + // Added to library - success feedback + Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success); + } + + // Call the original toggleLibrary function + toggleLibrary(); + }, [inLibrary, toggleLibrary]); + // Add new animated value for watch progress const watchProgressOpacity = useSharedValue(0); const watchProgressScaleY = useSharedValue(0); @@ -1023,46 +1048,91 @@ const MetadataScreen = () => { {/* Floating Header */} - - - - - - - - {metadata.logo ? ( - + + + + + + + {metadata.logo ? ( + + ) : ( + {metadata.name} + )} + + + + - ) : ( - {metadata.name} - )} - - - - - - - + + + + ) : ( + + + + + + + + + {metadata.logo ? ( + + ) : ( + {metadata.name} + )} + + + + + + + + )} {Platform.OS === 'ios' && } @@ -1129,7 +1199,7 @@ const MetadataScreen = () => { {/* Action Buttons */}