File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed
src/design-system/asset-input Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ interface Props {
15
15
testId ?: string ;
16
16
className ?: string ;
17
17
inputClassName ?: string ;
18
+ onBlur ?: ( event : React . FocusEvent < HTMLInputElement > ) => void ;
18
19
}
19
20
20
21
export const AmountInput = ( {
@@ -25,6 +26,7 @@ export const AmountInput = ({
25
26
testId,
26
27
className,
27
28
inputClassName,
29
+ onBlur,
28
30
} : Readonly < Props > ) : JSX . Element => {
29
31
return (
30
32
< Box className = { cn ( cx . amountInputSizer , className ) } data-value = { value } >
@@ -35,6 +37,7 @@ export const AmountInput = ({
35
37
onChange = { ( { target } ) : void => onChange ?.( target . value ) }
36
38
placeholder = "0.0"
37
39
data-testid = { testId ?? `asset-input-amount-input-${ id } ` }
40
+ onBlur = { onBlur }
38
41
/>
39
42
</ Box >
40
43
) ;
Original file line number Diff line number Diff line change @@ -16,13 +16,15 @@ interface Props {
16
16
onTickerClick ?: ( asset : Readonly < AssetWithFiat > ) => void ;
17
17
onAmountChange ?: ( asset : Readonly < AssetWithFiat > , amount : string ) => void ;
18
18
onMaxClick ?: ( asset : Readonly < AssetWithFiat > ) => void ;
19
+ onBlur ?: ( event : React . FocusEvent < HTMLInputElement > ) => void ;
19
20
}
20
21
21
22
export const AssetInput = ( {
22
23
state,
23
24
onTickerClick,
24
25
onAmountChange,
25
26
onMaxClick,
27
+ onBlur,
26
28
} : Readonly < Props > ) : JSX . Element => (
27
29
< div className = { cx . root } >
28
30
< Box className = { cx . assetNameBox } >
@@ -53,6 +55,7 @@ export const AssetInput = ({
53
55
onChange = { ( value ) : void => {
54
56
onAmountChange ?.( state . asset , value ) ;
55
57
} }
58
+ onBlur = { onBlur }
56
59
/>
57
60
</ Box >
58
61
</ Flex >
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export default {
33
33
const AssetInputMainComponents = ( ) : JSX . Element => (
34
34
< Variants . Row >
35
35
< Variants . Cell >
36
- < AssetInput state = { validState ( '1' ) } />
36
+ < AssetInput onBlur = { ( ) => console . log ( 'blur' ) } state = { validState ( '1' ) } />
37
37
</ Variants . Cell >
38
38
</ Variants . Row >
39
39
) ;
You can’t perform that action at this time.
0 commit comments