mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 01:40:12 +01:00
wip
This commit is contained in:
parent
4cf82c6a7e
commit
53532260ef
@ -70,23 +70,14 @@ const AddressInput = ({
|
||||
});
|
||||
|
||||
const onBlurEditing = () => {
|
||||
const validateAddressWithFeedback = (address: string) => {
|
||||
const isValid = DeeplinkSchemaMatch.isBitcoinAddress(address) ||
|
||||
DeeplinkSchemaMatch.isLightningInvoice(address);
|
||||
|
||||
triggerHapticFeedback(
|
||||
isValid
|
||||
? HapticFeedbackTypes.NotificationSuccess
|
||||
: HapticFeedbackTypes.NotificationError
|
||||
);
|
||||
const validateAddressWithFeedback = (value: string) => {
|
||||
const isValid = DeeplinkSchemaMatch.isBitcoinAddress(value) || DeeplinkSchemaMatch.isLightningInvoice(value);
|
||||
|
||||
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();
|
||||
};
|
||||
|
@ -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 && (
|
||||
|
@ -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),
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user