update: implement event-based photo storage, add event name validation, version apks
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { StyleSheet, View, SafeAreaView, StatusBar, ActivityIndicator } from 'react-native';
|
||||
import { StyleSheet, View, SafeAreaView, StatusBar, ActivityIndicator, Modal, TextInput, Text, TouchableOpacity } from 'react-native';
|
||||
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
||||
import CameraScreen from './src/screens/CameraScreen';
|
||||
import PreviewScreen from './src/screens/PreviewScreen';
|
||||
@@ -27,6 +27,8 @@ export default function App() {
|
||||
const [photoUris, setPhotoUris] = useState<string[]>([]);
|
||||
const [captureHistory, setCaptureHistory] = useState<number[]>([]);
|
||||
const [settings, setSettings] = useState<AppSettings | null>(null);
|
||||
const [showEventModal, setShowEventModal] = useState(false);
|
||||
const [tempEventName, setTempEventName] = useState('');
|
||||
|
||||
// 1. Load configuration settings on app start
|
||||
useEffect(() => {
|
||||
@@ -58,6 +60,25 @@ export default function App() {
|
||||
|
||||
// 2. Navigation Actions
|
||||
const handleStartBooth = () => {
|
||||
if (!settings?.eventText || settings.eventText.trim() === '') {
|
||||
setTempEventName('');
|
||||
setShowEventModal(true);
|
||||
return;
|
||||
}
|
||||
setPhotoUris([]);
|
||||
setCaptureHistory([]);
|
||||
setCurrentScreen('camera');
|
||||
};
|
||||
|
||||
const handleSaveEventName = async () => {
|
||||
if (!settings) return;
|
||||
const newName = tempEventName.trim() || 'Event';
|
||||
const updated = { ...settings, eventText: newName };
|
||||
await saveSettings(updated);
|
||||
setSettings(updated);
|
||||
setShowEventModal(false);
|
||||
|
||||
// Resume start
|
||||
setPhotoUris([]);
|
||||
setCaptureHistory([]);
|
||||
setCurrentScreen('camera');
|
||||
@@ -168,6 +189,7 @@ export default function App() {
|
||||
selectedFrameId={settings.selectedFrameId}
|
||||
footerText={settings.footerText}
|
||||
useFrontCamera={settings.useFrontCamera}
|
||||
eventText={settings.eventText}
|
||||
/>
|
||||
</View>
|
||||
|
||||
@@ -200,6 +222,34 @@ export default function App() {
|
||||
/>
|
||||
</View>
|
||||
)}
|
||||
|
||||
{/* Event Name Modal */}
|
||||
<Modal visible={showEventModal} transparent animationType="fade">
|
||||
<View style={styles.modalOverlay}>
|
||||
<View style={styles.modalContent}>
|
||||
<Text style={styles.modalTitle}>Kein Event-Name gefunden</Text>
|
||||
<Text style={styles.modalText}>
|
||||
Möchtest du jetzt einen festlegen? (Ansonsten kann kein Foto gemacht werden).
|
||||
</Text>
|
||||
<TextInput
|
||||
style={styles.modalInput}
|
||||
placeholder="z.B. Jannik's Party"
|
||||
placeholderTextColor="#666"
|
||||
value={tempEventName}
|
||||
onChangeText={setTempEventName}
|
||||
autoFocus
|
||||
/>
|
||||
<View style={styles.modalButtons}>
|
||||
<TouchableOpacity style={[styles.modalBtn, { backgroundColor: '#333' }]} onPress={() => setShowEventModal(false)}>
|
||||
<Text style={styles.modalBtnText}>Abbrechen</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity style={[styles.modalBtn, { backgroundColor: '#ff2bd6' }]} onPress={handleSaveEventName}>
|
||||
<Text style={styles.modalBtnText}>Speichern & Starten</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</Modal>
|
||||
</SafeAreaView>
|
||||
</GestureHandlerRootView>
|
||||
);
|
||||
@@ -216,4 +266,56 @@ const styles = StyleSheet.create({
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
},
|
||||
modalOverlay: {
|
||||
flex: 1,
|
||||
backgroundColor: 'rgba(0,0,0,0.8)',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
},
|
||||
modalContent: {
|
||||
backgroundColor: '#1a1a24',
|
||||
padding: 30,
|
||||
borderRadius: 16,
|
||||
width: '80%',
|
||||
maxWidth: 500,
|
||||
borderWidth: 1,
|
||||
borderColor: '#333',
|
||||
},
|
||||
modalTitle: {
|
||||
color: '#fff',
|
||||
fontSize: 24,
|
||||
fontWeight: 'bold',
|
||||
marginBottom: 10,
|
||||
},
|
||||
modalText: {
|
||||
color: '#aaa',
|
||||
fontSize: 16,
|
||||
marginBottom: 20,
|
||||
lineHeight: 24,
|
||||
},
|
||||
modalInput: {
|
||||
backgroundColor: '#0a0a14',
|
||||
borderWidth: 1,
|
||||
borderColor: '#333',
|
||||
borderRadius: 8,
|
||||
color: '#fff',
|
||||
padding: 15,
|
||||
fontSize: 18,
|
||||
marginBottom: 25,
|
||||
},
|
||||
modalButtons: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'flex-end',
|
||||
gap: 15,
|
||||
},
|
||||
modalBtn: {
|
||||
paddingVertical: 12,
|
||||
paddingHorizontal: 20,
|
||||
borderRadius: 8,
|
||||
},
|
||||
modalBtnText: {
|
||||
color: '#fff',
|
||||
fontSize: 16,
|
||||
fontWeight: 'bold',
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user