From 857afadb39a4e431d825d7cf7ac94455d8636ae7 Mon Sep 17 00:00:00 2001 From: tuliomir Date: Sat, 6 Jan 2024 21:45:13 -0300 Subject: [PATCH 1/4] feat: closes keyboard on screen press --- src/screens/CreateTokenAmount.js | 78 ++++++++++++++++---------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/src/screens/CreateTokenAmount.js b/src/screens/CreateTokenAmount.js index ecbcf9aa4..3f1575767 100644 --- a/src/screens/CreateTokenAmount.js +++ b/src/screens/CreateTokenAmount.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { KeyboardAvoidingView, Text, View } from 'react-native'; +import { Keyboard, KeyboardAvoidingView, Pressable, Text, View } from 'react-native'; import { get } from 'lodash'; import { connect } from 'react-redux'; import { t, jt } from 'ttag'; @@ -115,44 +115,46 @@ class CreateTokenAmount extends React.Component { return ( - this.props.navigation.goBack()} - onCancel={() => this.props.navigation.getParent().goBack()} - /> - - - - - {t`Amount of ${this.name} (${this.symbol})`} - - + Keyboard.dismiss()}> + this.props.navigation.goBack()} + onCancel={() => this.props.navigation.getParent().goBack()} + /> + + + + + {t`Amount of ${this.name} (${this.symbol})`} + + + + + {t`Deposit:`} + {hathorLib.numberUtils.prettyValue(this.state.deposit)} HTR + , + + {jt`You have ${amountAvailableText} HTR available`} + + ]} + /> + + - - {t`Deposit:`} - {hathorLib.numberUtils.prettyValue(this.state.deposit)} HTR - , - - {jt`You have ${amountAvailableText} HTR available`} - - ]} - /> - - - - - + + + ); } From dce527a70a7231a31b228d3d24e023e97932aaae Mon Sep 17 00:00:00 2001 From: tuliomir Date: Sat, 6 Jan 2024 21:47:13 -0300 Subject: [PATCH 2/4] feat: send amount closes keyboard on screen press --- src/screens/SendAmountInput.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/screens/SendAmountInput.js b/src/screens/SendAmountInput.js index 10d55dd02..746294444 100644 --- a/src/screens/SendAmountInput.js +++ b/src/screens/SendAmountInput.js @@ -7,7 +7,12 @@ import React from 'react'; import { - KeyboardAvoidingView, StyleSheet, Text, View, + Keyboard, + KeyboardAvoidingView, + Pressable, + StyleSheet, + Text, + View, } from 'react-native'; import { connect } from 'react-redux'; import { getStatusBarHeight } from 'react-native-status-bar-height'; @@ -143,12 +148,13 @@ class SendAmountInput extends React.Component { const tokenNameUpperCase = this.state.token.name.toUpperCase(); return ( - this.props.navigation.goBack()} - /> - + Keyboard.dismiss()}> + this.props.navigation.goBack()} + /> + + ); } From 548a966d646b6ac344d55301dc57218646e5ee23 Mon Sep 17 00:00:00 2001 From: tuliomir Date: Sat, 6 Jan 2024 21:49:38 -0300 Subject: [PATCH 3/4] feat: receive closes keyboard on screen press --- src/screens/Receive.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/screens/Receive.js b/src/screens/Receive.js index eb3110509..1bc572a9c 100644 --- a/src/screens/Receive.js +++ b/src/screens/Receive.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { Dimensions, Keyboard, View } from 'react-native'; +import { Dimensions, Keyboard, Pressable, View } from 'react-native'; import { t } from 'ttag'; import { TabBar, TabView } from 'react-native-tab-view'; @@ -102,18 +102,20 @@ class ReceiveScreen extends React.Component { return ( - - renderTabBar(props)} - navigationState={this.state} - renderScene={this.renderScene} - onIndexChange={this.handleIndexChange} - initialLayout={{ width: Dimensions.get('window').width }} - /> - + Keyboard.dismiss()}> + + renderTabBar(props)} + navigationState={this.state} + renderScene={this.renderScene} + onIndexChange={this.handleIndexChange} + initialLayout={{ width: Dimensions.get('window').width }} + /> + + ); } From f4bf7d028ba66f067945aa1107e2120d089dad7c Mon Sep 17 00:00:00 2001 From: tuliomir Date: Sat, 6 Jan 2024 22:16:13 -0300 Subject: [PATCH 4/4] style: lint --- src/screens/SendAmountInput.js | 64 +++++++++++++++++----------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/screens/SendAmountInput.js b/src/screens/SendAmountInput.js index 746294444..c75a05912 100644 --- a/src/screens/SendAmountInput.js +++ b/src/screens/SendAmountInput.js @@ -155,40 +155,40 @@ class SendAmountInput extends React.Component { onBackPress={() => this.props.navigation.goBack()} /> - - - - {renderGhostElement()} - - {IS_MULTI_TOKEN - ? - : renderGhostElement()} + + + + {renderGhostElement()} + + {IS_MULTI_TOKEN + ? + : renderGhostElement()} + + + {getAvailableString()} + + {this.state.error} - - {getAvailableString()} - - {this.state.error} + - - - - + + );