mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-03-11 19:30:29 -04:00
Update CredentialCard.tsx (#882)
This commit is contained in:
committed by
Leendert de Borst
parent
fbc085439c
commit
a1d2bcbe3b
@@ -97,31 +97,37 @@ export function CredentialCard({ credential, onCredentialDelete }: CredentialCar
|
||||
case 'Copy Username':
|
||||
if (credential.Username) {
|
||||
Clipboard.setStringAsync(credential.Username);
|
||||
Toast.show({
|
||||
type: 'success',
|
||||
text1: 'Username copied to clipboard',
|
||||
position: 'bottom',
|
||||
});
|
||||
if (Platform.OS === 'ios') {
|
||||
Toast.show({
|
||||
type: 'success',
|
||||
text1: 'Username copied to clipboard',
|
||||
position: 'bottom',
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'Copy Email':
|
||||
if (credential.Alias?.Email) {
|
||||
Clipboard.setStringAsync(credential.Alias.Email);
|
||||
Toast.show({
|
||||
type: 'success',
|
||||
text1: 'Email copied to clipboard',
|
||||
position: 'bottom',
|
||||
});
|
||||
if (Platform.OS === 'ios') {
|
||||
Toast.show({
|
||||
type: 'success',
|
||||
text1: 'Email copied to clipboard',
|
||||
position: 'bottom',
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'Copy Password':
|
||||
if (credential.Password) {
|
||||
Clipboard.setStringAsync(credential.Password);
|
||||
Toast.show({
|
||||
type: 'success',
|
||||
text1: 'Password copied to clipboard',
|
||||
position: 'bottom',
|
||||
});
|
||||
if (Platform.OS === 'ios') {
|
||||
Toast.show({
|
||||
type: 'success',
|
||||
text1: 'Password copied to clipboard',
|
||||
position: 'bottom',
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -224,6 +230,7 @@ export function CredentialCard({ credential, onCredentialDelete }: CredentialCar
|
||||
title="Credential Options"
|
||||
actions={getMenuActions()}
|
||||
onPress={handleContextMenuAction}
|
||||
previewBackgroundColor={colors.accentBackground}
|
||||
>
|
||||
<TouchableOpacity
|
||||
style={styles.credentialCard}
|
||||
@@ -231,6 +238,9 @@ export function CredentialCard({ credential, onCredentialDelete }: CredentialCar
|
||||
Keyboard.dismiss();
|
||||
router.push(`/(tabs)/credentials/${credential.Id}`);
|
||||
}}
|
||||
onLongPress={() => {
|
||||
// Ignore long press to prevent context menu long press from triggering the credential card press.
|
||||
}}
|
||||
activeOpacity={0.7}
|
||||
>
|
||||
<View style={styles.credentialContent}>
|
||||
|
||||
Reference in New Issue
Block a user