From 8c69c40361d9e2556172a9da8d6bcd29d5ef770a Mon Sep 17 00:00:00 2001 From: deregs Date: Tue, 15 Feb 2022 23:47:08 -0500 Subject: [PATCH 1/3] fixed keyboard collapse on set fees form --- components/SetFeesForm.tsx | 341 +++++++++++++++++++------------------ 1 file changed, 176 insertions(+), 165 deletions(-) diff --git a/components/SetFeesForm.tsx b/components/SetFeesForm.tsx index b50bb0187b..f3a3de818d 100644 --- a/components/SetFeesForm.tsx +++ b/components/SetFeesForm.tsx @@ -1,5 +1,11 @@ import * as React from 'react'; -import { StyleSheet, Text, View } from 'react-native'; +import { + StyleSheet, + Text, + View, + Keyboard, + TouchableWithoutFeedback +} from 'react-native'; import { inject, observer } from 'mobx-react'; import Button from './../components/Button'; @@ -124,183 +130,188 @@ export default class SetFeesForm extends React.Component< )} {(expanded || showNewFeesForm) && ( - - {loading && } - {feesSubmitted && setFeesSuccess && ( - + + {loading && } + {feesSubmitted && setFeesSuccess && ( + + )} + {feesSubmitted && setFeesError && ( + + )} + + + {`${localeString( + 'components.SetFeesForm.baseFee' + )} (${localeString('general.sats')})`} + + + this.setState({ + newBaseFee: text + }) + } + autoCapitalize="none" + autoCorrect={false} /> - )} - {feesSubmitted && setFeesError && ( - + {`${localeString( + 'components.SetFeesForm.feeRate' + )} (${ + implementation === 'c-lightning-REST' + ? localeString( + 'components.SetFeesForm.ppmMilliMsat' ) + : localeString('general.percentage') + })`} + + + this.setState({ + newFeeRate: text + }) } + autoCapitalize="none" + autoCorrect={false} /> - )} - - {`${localeString( - 'components.SetFeesForm.baseFee' - )} (${localeString('general.sats')})`} - - - this.setState({ - newBaseFee: text - }) - } - autoCapitalize="none" - autoCorrect={false} - /> + + {localeString( + 'components.SetFeesForm.timeLockDelta' + )} + + + this.setState({ + newTimeLockDelta: text + }) + } + autoCapitalize="none" + autoCorrect={false} + /> - - {`${localeString( - 'components.SetFeesForm.feeRate' - )} (${ - implementation === 'c-lightning-REST' - ? localeString( - 'components.SetFeesForm.ppmMilliMsat' - ) - : localeString('general.percentage') - })`} - - - this.setState({ - newFeeRate: text - }) - } - autoCapitalize="none" - autoCorrect={false} - /> + {implementation === 'lnd' && ( + <> + + {localeString( + 'components.SetFeesForm.minHtlc' + )} + + + this.setState({ + newMinHtlc: text + }) + } + autoCapitalize="none" + autoCorrect={false} + /> - - {localeString( - 'components.SetFeesForm.timeLockDelta' + + {localeString( + 'components.SetFeesForm.maxHtlc' + )} + + + this.setState({ + newMaxHtlc: text + }) + } + autoCapitalize="none" + autoCorrect={false} + /> + )} - - - this.setState({ - newTimeLockDelta: text - }) - } - autoCapitalize="none" - autoCorrect={false} - /> - {implementation === 'lnd' && ( - <> - - {localeString( - 'components.SetFeesForm.minHtlc' + +