Skip to content

Commit

Permalink
fix: update the default value of Minimum funding amount when value ch…
Browse files Browse the repository at this point in the history
…anges
  • Loading branch information
apsinghdev committed Oct 21, 2024
1 parent f1a7b5e commit 06e55ec
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AttachMoneyOutlined } from '@mui/icons-material'
import { ChangeEvent, FocusEvent, useCallback, useState } from 'react'
import { ChangeEvent, FocusEvent, useCallback, useState, useEffect } from 'react'
import { twMerge } from 'tailwind-merge'
import Input from './Input'

Expand Down Expand Up @@ -43,6 +43,12 @@ const MoneyInput = (props: Props) => {
value ? (value / 100).toFixed(2) : undefined,
)

useEffect(() => {
if (value !== undefined) {
setInternalValue((value / 100).toFixed(2))
}
}, [value])

const onChange = useCallback(
(e: ChangeEvent<HTMLInputElement>) => {
if (_onChange) {
Expand Down

0 comments on commit 06e55ec

Please sign in to comment.