feat(native): Geräte-Liste informativ — Trash/Menü raus, chevron-forward → Detail
Entfernen passiert am Gerät selbst (Cooldown, win-App/Mac), nicht aus der Liste gesteuert. Row-Pfeil öffnet nur das Info-/Detail-Sheet. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
db6db547ff
commit
e0eb1711db
@ -132,21 +132,6 @@ function MobileDeviceRow({
|
|||||||
: null;
|
: null;
|
||||||
const releaseActive = !!releaseAt && new Date(releaseAt).getTime() > Date.now();
|
const releaseActive = !!releaseAt && new Date(releaseAt).getTime() > Date.now();
|
||||||
|
|
||||||
function confirmRemove() {
|
|
||||||
Alert.alert(
|
|
||||||
t('settings.devices_remove_title'),
|
|
||||||
t('settings.devices_remove_desc'),
|
|
||||||
[
|
|
||||||
{ text: t('common.cancel'), style: 'cancel' },
|
|
||||||
{
|
|
||||||
text: t('settings.devices_remove_confirm'),
|
|
||||||
style: 'destructive',
|
|
||||||
onPress: () => onRemove(device.id),
|
|
||||||
},
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function confirmRequestRelease() {
|
function confirmRequestRelease() {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
t('devices.release_request_title'),
|
t('devices.release_request_title'),
|
||||||
@ -301,7 +286,7 @@ function MobileDeviceRow({
|
|||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
{device.isCurrent ? null : releaseActive ? (
|
{releaseActive ? (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
onPress={confirmCancelRelease}
|
onPress={confirmCancelRelease}
|
||||||
hitSlop={8}
|
hitSlop={8}
|
||||||
@ -318,12 +303,14 @@ function MobileDeviceRow({
|
|||||||
<Ionicons name="lock-open-outline" size={18} color={colors.error} />
|
<Ionicons name="lock-open-outline" size={18} color={colors.error} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
) : (
|
) : (
|
||||||
|
// Entfernen passiert am Gerät selbst (Cooldown), nicht aus der Liste —
|
||||||
|
// Pfeil öffnet nur das Info-/Detail-Sheet.
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
onPress={confirmRemove}
|
onPress={openDetail}
|
||||||
hitSlop={8}
|
hitSlop={8}
|
||||||
activeOpacity={0.5}
|
activeOpacity={0.5}
|
||||||
>
|
>
|
||||||
<Ionicons name="trash-outline" size={18} color={colors.error} />
|
<Ionicons name="chevron-forward" size={18} color={colors.textMuted} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
@ -367,31 +354,6 @@ function ProtectedDeviceRow({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const menuActions = device.status === 'pending'
|
|
||||||
? [
|
|
||||||
{ id: 'remove', title: t('settings.devices_remove_confirm'), attributes: { destructive: true } },
|
|
||||||
]
|
|
||||||
: [
|
|
||||||
{ id: 'remove', title: t('settings.devices_remove_confirm'), attributes: { destructive: true } },
|
|
||||||
];
|
|
||||||
|
|
||||||
function handleMenuSelect(id: string) {
|
|
||||||
if (id === 'remove') {
|
|
||||||
Alert.alert(
|
|
||||||
t('devices.remove_warning_title'),
|
|
||||||
t('devices.remove_warning_body'),
|
|
||||||
[
|
|
||||||
{ text: t('common.cancel'), style: 'cancel' },
|
|
||||||
{
|
|
||||||
text: t('settings.devices_remove_confirm'),
|
|
||||||
style: 'destructive',
|
|
||||||
onPress: () => onRemove(device.id),
|
|
||||||
},
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
@ -456,19 +418,10 @@ function ProtectedDeviceRow({
|
|||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
<MenuView
|
{/* Kein Entfernen aus der Liste — Pfeil öffnet nur das Detail-Sheet. */}
|
||||||
title={device.label}
|
<TouchableOpacity onPress={openDetail} hitSlop={8} activeOpacity={0.5}>
|
||||||
actions={menuActions}
|
<Ionicons name="chevron-forward" size={18} color={colors.textMuted} />
|
||||||
onPressAction={({ nativeEvent: { event } }) => handleMenuSelect(event)}
|
|
||||||
shouldOpenOnLongPress={false}
|
|
||||||
>
|
|
||||||
<TouchableOpacity
|
|
||||||
hitSlop={8}
|
|
||||||
activeOpacity={0.5}
|
|
||||||
>
|
|
||||||
<Ionicons name="ellipsis-horizontal" size={18} color={colors.textMuted} />
|
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</MenuView>
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user