diff --git a/components/AmountInput.tsx b/components/AmountInput.tsx index 42fd28740..ca1012535 100644 --- a/components/AmountInput.tsx +++ b/components/AmountInput.tsx @@ -21,6 +21,7 @@ interface AmountInputProps { onAmountChange: (amount: string, satAmount: string | number) => void; amount?: string; locked?: boolean; + disabled?: boolean; title?: string; hideConversion?: boolean; hideUnitChangeButton?: boolean; @@ -129,6 +130,7 @@ export default class AmountInput extends React.Component< onAmountChange, title, locked, + disabled, hideConversion, hideUnitChangeButton, FiatStore, @@ -164,7 +166,7 @@ export default class AmountInput extends React.Component< onAmountChange(formatted, satAmount); this.setState({ satAmount }); }} - locked={locked} + locked={locked || disabled} prefix={ units !== 'sats' && (units === 'BTC' diff --git a/views/OpenChannel.tsx b/views/OpenChannel.tsx index 52fcd6ae0..e0078bd75 100644 --- a/views/OpenChannel.tsx +++ b/views/OpenChannel.tsx @@ -14,7 +14,6 @@ import { Route } from '@react-navigation/native'; import { StackNavigationProp } from '@react-navigation/stack'; import { Tab } from 'react-native-elements'; -import Amount from '../components/Amount'; import AmountInput from '../components/AmountInput'; import Button from '../components/Button'; import DropdownSetting from '../components/DropdownSetting'; @@ -569,40 +568,31 @@ export default class OpenChannel extends React.Component< {!connectPeerOnly && ( <> - {!fundMax && ( - { - this.setState({ - local_funding_amount: amount, - satAmount - }); - }} - hideConversion={ - local_funding_amount === 'all' - } - /> - )} - - {(local_funding_amount === 'all' || - fundMax) && ( - - 0 - ? utxoBalance - : confirmedBlockchainBalance - } - toggleable - /> - - )} + 0 + ? utxoBalance.toString() + : confirmedBlockchainBalance.toString() + : local_funding_amount + } + title={localeString( + 'views.OpenChannel.localAmt' + )} + onAmountChange={( + amount: string, + satAmount: string | number + ) => { + this.setState({ + local_funding_amount: amount, + satAmount + }); + }} + hideConversion={ + local_funding_amount === 'all' + } + disabled={fundMax} + /> {BackendUtils.supportsChannelFundMax() && additionalChannels.length === 0 && (