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 {
1515 testId ?: string ;
1616 className ?: string ;
1717 inputClassName ?: string ;
18+ onBlur ?: ( event : React . FocusEvent < HTMLInputElement > ) => void ;
1819}
1920
2021export const AmountInput = ( {
@@ -25,6 +26,7 @@ export const AmountInput = ({
2526 testId,
2627 className,
2728 inputClassName,
29+ onBlur,
2830} : Readonly < Props > ) : JSX . Element => {
2931 return (
3032 < Box className = { cn ( cx . amountInputSizer , className ) } data-value = { value } >
@@ -35,6 +37,7 @@ export const AmountInput = ({
3537 onChange = { ( { target } ) : void => onChange ?.( target . value ) }
3638 placeholder = "0.0"
3739 data-testid = { testId ?? `asset-input-amount-input-${ id } ` }
40+ onBlur = { onBlur }
3841 />
3942 </ Box >
4043 ) ;
Original file line number Diff line number Diff line change @@ -16,13 +16,15 @@ interface Props {
1616 onTickerClick ?: ( asset : Readonly < AssetWithFiat > ) => void ;
1717 onAmountChange ?: ( asset : Readonly < AssetWithFiat > , amount : string ) => void ;
1818 onMaxClick ?: ( asset : Readonly < AssetWithFiat > ) => void ;
19+ onBlur ?: ( event : React . FocusEvent < HTMLInputElement > ) => void ;
1920}
2021
2122export const AssetInput = ( {
2223 state,
2324 onTickerClick,
2425 onAmountChange,
2526 onMaxClick,
27+ onBlur,
2628} : Readonly < Props > ) : JSX . Element => (
2729 < div className = { cx . root } >
2830 < Box className = { cx . assetNameBox } >
@@ -53,6 +55,7 @@ export const AssetInput = ({
5355 onChange = { ( value ) : void => {
5456 onAmountChange ?.( state . asset , value ) ;
5557 } }
58+ onBlur = { onBlur }
5659 />
5760 </ Box >
5861 </ Flex >
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export default {
3333const AssetInputMainComponents = ( ) : JSX . Element => (
3434 < Variants . Row >
3535 < Variants . Cell >
36- < AssetInput state = { validState ( '1' ) } />
36+ < AssetInput onBlur = { ( ) => console . log ( 'blur' ) } state = { validState ( '1' ) } />
3737 </ Variants . Cell >
3838 </ Variants . Row >
3939) ;
You can’t perform that action at this time.
0 commit comments