This commit is contained in:
Marcos Rodriguez Velez 2024-10-22 18:26:36 -04:00
parent 4cf82c6a7e
commit 53532260ef
4 changed files with 15 additions and 24 deletions

View File

@ -70,23 +70,14 @@ const AddressInput = ({
});
const onBlurEditing = () => {
const validateAddressWithFeedback = (address: string) => {
const isValid = DeeplinkSchemaMatch.isBitcoinAddress(address) ||
DeeplinkSchemaMatch.isLightningInvoice(address);
const validateAddressWithFeedback = (value: string) => {
const isValid = DeeplinkSchemaMatch.isBitcoinAddress(value) || DeeplinkSchemaMatch.isLightningInvoice(value);
triggerHapticFeedback(
isValid
? HapticFeedbackTypes.NotificationSuccess
: HapticFeedbackTypes.NotificationError
);
triggerHapticFeedback(isValid ? HapticFeedbackTypes.NotificationSuccess : HapticFeedbackTypes.NotificationError);
return isValid;
};
if (DeeplinkSchemaMatch.isBitcoinAddress(address) || DeeplinkSchemaMatch.isLightningInvoice(address)) {
triggerHapticFeedback(HapticFeedbackTypes.NotificationSuccess);
} else {
triggerHapticFeedback(HapticFeedbackTypes.NotificationError);
}
validateAddressWithFeedback(address);
onBlur();
Keyboard.dismiss();
};

View File

@ -61,7 +61,7 @@ const TotalWalletsBalance: React.FC = () => {
}, [preferredFiatCurrency.endPointKey, totalBalancePreferredUnit]);
const onPressMenuItem = useMemo(
() => async (id: string) => {
() => async (id: string | number) => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
switch (id) {
case CommonToolTipActions.ViewInFiat.id:
@ -99,7 +99,7 @@ const TotalWalletsBalance: React.FC = () => {
<ToolTipMenu actions={toolTipActions} onPressMenuItem={onPressMenuItem}>
<View style={styles.container}>
<Text style={styles.label}>{loc.wallets.total_balance}</Text>
<TouchableOpacity onPress={() => onPressMenuItem(CommonToolTipActions.ViewInBitcoin.id.toString())}>
<TouchableOpacity onPress={() => onPressMenuItem(CommonToolTipActions.ViewInBitcoin.id)}>
<Text style={[styles.balance, styleHooks.balance]}>
{formattedBalance}{' '}
{totalBalancePreferredUnit !== BitcoinUnit.LOCAL_CURRENCY && (

View File

@ -994,19 +994,19 @@ const SendDetails = () => {
const importActions = [
{
...CommonToolTipActions.ImportTransaction,
hidden: !(wallet?.type === WatchOnlyWallet.type && wallet.isHd()),
hidden: !(wallet?.type === WatchOnlyWallet.type && wallet?.isHd()),
},
{
...CommonToolTipActions.ImportTransactionQR,
hidden: !(wallet?.type === WatchOnlyWallet.type && wallet.isHd()),
hidden: !(wallet?.type === WatchOnlyWallet.type && wallet?.isHd()),
},
{
...CommonToolTipActions.ImportTransactionMultsig,
hidden: !(wallet?.type === MultisigHDWallet.type && wallet.howManySignaturesCanWeMake() > 0),
hidden: !(wallet?.type === MultisigHDWallet.type && wallet?.howManySignaturesCanWeMake() > 0),
},
{
...CommonToolTipActions.CoSignTransaction,
hidden: !(wallet?.type === MultisigHDWallet.type && wallet.howManySignaturesCanWeMake() > 0),
hidden: !(wallet?.type === MultisigHDWallet.type && wallet?.howManySignaturesCanWeMake() > 0),
},
];

View File

@ -20,7 +20,7 @@ const keys = {
Passphrase: 'passphrase',
MoreInfo: 'moreInfo',
SaveChanges: 'saveChanges',
PaymentsCode: 'paymentsCode',
PaymentCode: 'paymentCode',
RemoveAllRecipients: 'RemoveAllRecipients',
AddRecipient: 'AddRecipient',
RemoveRecipient: 'RemoveRecipient',
@ -62,7 +62,7 @@ const icons: { [key: string]: { iconValue: string } } = {
ImportTransactionQR: { iconValue: 'qrcode.viewfinder' },
CoinControl: { iconValue: 'switch.2' },
CoSignTransaction: { iconValue: 'signature' },
PaymentsCode: { iconValue: 'qrcode' },
PaymentCode: { iconValue: 'qrcode' },
RemoveAllRecipients: { iconValue: 'person.2.slash' },
AddRecipient: { iconValue: 'person.badge.plus' },
RemoveRecipient: { iconValue: 'person.badge.minus' },
@ -177,9 +177,9 @@ export const CommonToolTipActions: { [key: string]: Action } = {
icon: icons.SaveChanges,
},
PaymentCode: {
id: keys.PaymentsCode,
id: keys.PaymentCode,
text: loc.bip47.purpose,
icon: icons.PaymentsCode,
icon: icons.PaymentCode,
menuState: false,
},
ScanQR: {