From d88e37e3a27beb01dc244787f253da4a97cf71a3 Mon Sep 17 00:00:00 2001 From: jorbuedo Date: Thu, 17 Oct 2024 12:41:40 +0200 Subject: [PATCH] fix autofocus and caret color for send edit amount --- .../ListAmountsToSend/EditAmount/EditAmountScreen.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/EditAmount/EditAmountScreen.tsx b/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/EditAmount/EditAmountScreen.tsx index 0951dbc003..5b3a27009a 100644 --- a/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/EditAmount/EditAmountScreen.tsx +++ b/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/EditAmount/EditAmountScreen.tsx @@ -46,7 +46,7 @@ export const EditAmountScreen = () => { const [quantity, setQuantity] = React.useState(initialQuantity) const [inputValue, setInputValue] = React.useState( - atomicBreakdown(initialQuantity, amount.info.decimals).bn.toFormat(), + initialQuantity === 0n ? '' : atomicBreakdown(initialQuantity, amount.info.decimals).bn.toFormat(), ) const spendable = isPrimary ? available - primaryBreakdown.lockedAsStorageCost : available @@ -54,7 +54,7 @@ export const EditAmountScreen = () => { React.useEffect(() => { setQuantity(initialQuantity) - setInputValue(atomicBreakdown(initialQuantity, amount.info.decimals).bn.toFormat()) + setInputValue(initialQuantity === 0n ? '' : atomicBreakdown(initialQuantity, amount.info.decimals).bn.toFormat()) }, [amount.info.decimals, initialQuantity]) const isFocused = useIsFocused() @@ -216,6 +216,7 @@ const AmountInput = ({onChange, value, ticker}: AmountInputProps) => { underlineColorAndroid="transparent" activeUnderlineColor="transparent" selectionColor={colors.selected} + cursorColor={colors.cursor} noHelper /> ) @@ -272,7 +273,7 @@ const useStyles = () => { }, }) const colors = { - black: color.gray_max, + cursor: color.el_gray_max, selected: color.input_selected, } return {styles, colors} as const