apply suggestions

This commit is contained in:
Dmitrijs Minajevs
2024-10-14 12:03:06 +03:00
committed by Joel Jeremy Marquez
parent da068173e4
commit fb9924aced

View File

@@ -187,6 +187,10 @@ export const FocusableAmountInput = memo(function FocusableAmountInput({
const [isNegative, setIsNegative] = useState(true);
const [focused, setFocused] = useState(defaultFocused ?? false);
useEffect(() => {
setFocused(defaultFocused ?? false);
}, [defaultFocused]);
const maybeApplyNegative = (amount: number, negative: boolean) => {
const absValue = Math.abs(amount);
return negative ? -absValue : absValue;