mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-22 15:04:50 +01:00
Merge pull request #7024 from BlueWallet/Cant-use-full-balance-or-coin-control,-windows-are-not-modal-on-Mac-#7017
FIX: Cant use full balance or coin control, windows are not modal on …
This commit is contained in:
commit
a4c16a8d38
1 changed files with 25 additions and 27 deletions
|
@ -7,6 +7,7 @@ import {
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
Alert,
|
Alert,
|
||||||
Dimensions,
|
Dimensions,
|
||||||
|
findNodeHandle,
|
||||||
FlatList,
|
FlatList,
|
||||||
I18nManager,
|
I18nManager,
|
||||||
Keyboard,
|
Keyboard,
|
||||||
|
@ -55,6 +56,7 @@ import { useStorage } from '../../hooks/context/useStorage';
|
||||||
import { Action } from '../../components/types';
|
import { Action } from '../../components/types';
|
||||||
import SelectFeeModal from '../../components/SelectFeeModal';
|
import SelectFeeModal from '../../components/SelectFeeModal';
|
||||||
import { useKeyboard } from '../../hooks/useKeyboard';
|
import { useKeyboard } from '../../hooks/useKeyboard';
|
||||||
|
import ActionSheet from '../ActionSheet';
|
||||||
|
|
||||||
interface IPaymentDestinations {
|
interface IPaymentDestinations {
|
||||||
address: string; // btc address or payment code
|
address: string; // btc address or payment code
|
||||||
|
@ -1081,34 +1083,30 @@ const SendDetails = () => {
|
||||||
const onUseAllPressed = () => {
|
const onUseAllPressed = () => {
|
||||||
triggerHapticFeedback(HapticFeedbackTypes.NotificationWarning);
|
triggerHapticFeedback(HapticFeedbackTypes.NotificationWarning);
|
||||||
const message = frozenBalance > 0 ? loc.send.details_adv_full_sure_frozen : loc.send.details_adv_full_sure;
|
const message = frozenBalance > 0 ? loc.send.details_adv_full_sure_frozen : loc.send.details_adv_full_sure;
|
||||||
Alert.alert(
|
|
||||||
loc.send.details_adv_full,
|
const anchor = findNodeHandle(scrollView.current);
|
||||||
|
const options = {
|
||||||
|
title: loc.send.details_adv_full,
|
||||||
message,
|
message,
|
||||||
[
|
options: [loc._.cancel, loc._.ok],
|
||||||
{
|
cancelButtonIndex: 0,
|
||||||
text: loc._.ok,
|
anchor: anchor ?? undefined,
|
||||||
onPress: () => {
|
};
|
||||||
Keyboard.dismiss();
|
|
||||||
setAddresses(addrs => {
|
ActionSheet.showActionSheetWithOptions(options, buttonIndex => {
|
||||||
addrs[scrollIndex.current].amount = BitcoinUnit.MAX;
|
if (buttonIndex === 1) {
|
||||||
addrs[scrollIndex.current].amountSats = BitcoinUnit.MAX;
|
Keyboard.dismiss();
|
||||||
return [...addrs];
|
setAddresses(addrs => {
|
||||||
});
|
addrs[scrollIndex.current].amount = BitcoinUnit.MAX;
|
||||||
setUnits(u => {
|
addrs[scrollIndex.current].amountSats = BitcoinUnit.MAX;
|
||||||
u[scrollIndex.current] = BitcoinUnit.BTC;
|
return [...addrs];
|
||||||
return [...u];
|
});
|
||||||
});
|
setUnits(u => {
|
||||||
},
|
u[scrollIndex.current] = BitcoinUnit.BTC;
|
||||||
style: 'default',
|
return [...u];
|
||||||
},
|
});
|
||||||
{
|
}
|
||||||
text: loc._.cancel,
|
});
|
||||||
onPress: () => {},
|
|
||||||
style: 'cancel',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
{ cancelable: false },
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatFee = (fee: number) => formatBalance(fee, feeUnit!, true);
|
const formatFee = (fee: number) => formatBalance(fee, feeUnit!, true);
|
||||||
|
|
Loading…
Add table
Reference in a new issue