feat: replace native alerts with custom dialog modals
All checks were successful
Luggage List Build / build-web (push) Successful in 27s
Luggage List Build / build-android (push) Successful in 9m46s
Luggage List Build / release (push) Successful in 21s

This commit is contained in:
2026-04-18 15:20:25 +02:00
parent a93fec97dc
commit fb54db0619
4 changed files with 197 additions and 71 deletions

View File

@@ -1,25 +1,8 @@
import React from 'react';
import { Alert, Pressable, Text, View } from 'react-native';
import { Pressable, Text, View } from 'react-native';
import { styles } from '../styles';
export default function HistoryTab({
selectedTrip,
selectedTripCheckups,
selectedCheckupId,
setSelectedCheckupId,
onDeleteCheckup,
}) {
function askDelete(checkup) {
Alert.alert('Delete check-up?', 'This snapshot will be removed from history.', [
{ text: 'Cancel', style: 'cancel' },
{
text: 'Delete',
style: 'destructive',
onPress: () => onDeleteCheckup(checkup.id),
},
]);
}
export default function HistoryTab({ selectedTrip, selectedTripCheckups, selectedCheckupId, setSelectedCheckupId, onDeleteCheckup }) {
return (
<View style={styles.section}>
<Text style={styles.sectionTitle}>History</Text>
@@ -32,7 +15,7 @@ export default function HistoryTab({
<View key={checkup.id} style={styles.cardSoft}>
<Pressable
onPress={() => setSelectedCheckupId((prev) => (prev === checkup.id ? null : checkup.id))}
onLongPress={() => askDelete(checkup)}
onLongPress={() => onDeleteCheckup(checkup.id)}
delayLongPress={280}
>
<Text style={styles.cardTitle}>{new Date(checkup.createdAt).toLocaleString()}</Text>