// Firebase functionality temporarily disabled - see dataService.ts for placeholders import React, { useState, useEffect } from 'react'; import { useDebugBorders } from '../../hooks/useDebugBorders'; import { View, StyleSheet, ScrollView, Dimensions, Pressable, TextInput, Alert, Animated, NativeSyntheticEvent, NativeScrollEvent, Image as RNImage } from 'react-native'; import { useRouter } from 'expo-router'; import { Image } from 'react-native'; import Text from '../atoms/Text'; import Button from '../atoms/Button'; interface SceneProps { images: { uri: string }[]; texts: string[]; textVariant?: 'header' | 'subheader' | 'body' | 'caption'; textColor?: string; onPress?: () => void; variant?: 'story' | 'end' | 'start'; onEndPress?: () => void; onRestartPress?: () => void; onArchivePress?: () => void; scrollViewRef?: React.RefObject; onScroll?: (event: NativeSyntheticEvent) => void; storyId?: string; uid?: string; characterName?: string; } const Scene: React.FC = ({ images, texts, textVariant = 'body', textColor = '#FFFFFF', onPress, variant = 'story', onEndPress, onRestartPress, onArchivePress, scrollViewRef, onScroll, storyId, uid, characterName, }) => { const debugBorder = useDebugBorders('#FF0000'); const debugBorderBlue = useDebugBorders('#0000FF'); const debugBorderGreen = useDebugBorders('#00FF00'); const [currentPage, setCurrentPage] = useState(1); const [feedbackText, setFeedbackText] = useState(''); const [isSaving, setIsSaving] = useState(false); const [showToast, setShowToast] = useState(false); const toastOpacity = useState(new Animated.Value(0))[0]; // Handle toast animation useEffect(() => { if (showToast) { Animated.sequence([ Animated.timing(toastOpacity, { toValue: 1, duration: 300, useNativeDriver: true, }), Animated.delay(2000), Animated.timing(toastOpacity, { toValue: 0, duration: 300, useNativeDriver: true, }), ]).start(() => setShowToast(false)); } }, [showToast]); const { width: screenWidth, height: screenHeight } = Dimensions.get('window'); // Calculate image dimensions with max constraints const maxWidth = Math.min(500, screenWidth * 0.8); // Maximum width is 80% of screen width or 500px const maxHeight = Math.min(500, screenHeight * 0.45); // Maximum height is 45% of screen height or 500px const imageWidth = maxWidth; const imageHeight = maxHeight; // Calculate total content height to ensure proper vertical centering const textHeight = 250; // Reduziert für weniger Abstand const totalContentHeight = imageHeight + textHeight; // Minimaler Top-Padding von 20px für die Notch, reduziert von 40px const topPadding = Math.max(20, (screenHeight - totalContentHeight) / 3); // Reduziert von /2 auf /3 return ( {images.map((image, index) => ( {(index === 0 && texts[0] !== 'Ende' && images.length > 1) ? ( {texts[index]} {characterName && ( Eine Geschichte mit {characterName} )} Wische um zu beginnen → ) : (variant === 'end' && index === texts.length - 1) ? ( {texts[index]} Schreibe uns dein Feedback