From 9a993fc3f26b514846d26ad69891d384d0b6fd5a Mon Sep 17 00:00:00 2001 From: shubham Date: Fri, 8 Mar 2024 14:35:58 +0530 Subject: [PATCH] CurrencyConverter: Fixed scrolling and improve margin/padding of currency inputs --- views/Settings/CurrencyConverter.tsx | 343 +++++++++++++++------------ 1 file changed, 186 insertions(+), 157 deletions(-) diff --git a/views/Settings/CurrencyConverter.tsx b/views/Settings/CurrencyConverter.tsx index 984fb8a56..4bf953138 100644 --- a/views/Settings/CurrencyConverter.tsx +++ b/views/Settings/CurrencyConverter.tsx @@ -5,7 +5,8 @@ import { View, StyleSheet, Animated, - Easing + Easing, + ScrollView } from 'react-native'; import Svg, { Text } from 'react-native-svg'; import DragList, { DragListRenderItemInfo } from 'react-native-draglist'; @@ -454,167 +455,195 @@ export default class CurrencyConverter extends React.Component< /> ) : ( - - item} - renderItem={({ - item, - onDragStart, - onDragEnd - }: DragListRenderItemInfo) => { - const { inputValues } = this.state; - return ( - - - {editMode && - item !== 'BTC' && - item !== 'sats' && ( - - this.handleDeleteCurrency( - item - ) - } - > - + + + item} + renderItem={({ + item, + onDragStart, + onDragEnd + }: DragListRenderItemInfo) => { + const { inputValues } = this.state; + return ( + + + {editMode && + item !== 'BTC' && + item !== 'sats' && ( + + this.handleDeleteCurrency( + item + ) + } + > + - - - - )} - - + + + + )} + + - - {['BTC', 'sats'].includes( - item - ) ? ( - - ) : ( - + - - {getFlagEmoji( + {[ + 'BTC', + 'sats' + ].includes(item) ? ( + + ) : ( + + + {getFlagEmoji( + item + )} + + + )} + + + - - )} - - - - this.handleInputChange( - value, - item - ) - } - autoCapitalize="none" - /> - - - {editMode && - item !== 'BTC' && - item !== 'sats' && ( - - + this.handleInputChange( + value, + item + ) + } + autoCapitalize="none" + /> + + + {editMode && + item !== 'BTC' && + item !== 'sats' && ( + + - - - - )} - - - ); - }} - /> + ]} + > + + + + )} + + + ); + }} + /> + + )} @@ -635,7 +664,7 @@ const styles = StyleSheet.create({ }, deleteIcon: { marginRight: 16, - marginLeft: -6 + marginLeft: 0 }, draggableItem: { flexDirection: 'row', @@ -644,6 +673,6 @@ const styles = StyleSheet.create({ }, dragHandle: { marginLeft: 16, - marginRight: -6 + marginRight: 0 } });