File tree Expand file tree Collapse file tree 5 files changed +14
-14
lines changed Expand file tree Collapse file tree 5 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,15 @@ interface Props {
1010 onChange ?: ( value : string ) => void ;
1111 value ?: string ;
1212 id : string ;
13+ testId ?: string ;
1314}
1415
1516export const AmountInput = ( {
1617 alignment = 'right' ,
1718 onChange,
1819 value,
1920 id,
21+ testId,
2022} : Readonly < Props > ) : JSX . Element => {
2123 return (
2224 < Box className = { cx . amountInputSizer } data-value = { value } >
@@ -26,7 +28,7 @@ export const AmountInput = ({
2628 size = { 1 }
2729 onChange = { ( { target } ) : void => onChange ?.( target . value ) }
2830 placeholder = "0.0"
29- data-testid = { `asset-input-amount-input-${ id } ` }
31+ data-testid = { testId ?? `asset-input-amount-input-${ id } ` }
3032 />
3133 </ Box >
3234 ) ;
Original file line number Diff line number Diff line change 11export { AssetInput } from './asset-input.component' ;
22export { SimpleAssetInput } from './simple-asset-input.component' ;
3- export * as Data from './asset-input.data' ;
3+ export * from './asset-input.data' ;
Original file line number Diff line number Diff line change @@ -12,12 +12,14 @@ interface Props {
1212 state : AssetState < Asset > ;
1313 balanceLabel : string ;
1414 onAmountChange ?: ( asset : Readonly < Asset > , amount : string ) => void ;
15+ testId ?: string ;
1516}
1617
1718export const SimpleAssetInput = ( {
1819 state,
1920 balanceLabel,
2021 onAmountChange,
22+ testId,
2123} : Readonly < Props > ) : JSX . Element => (
2224 < div className = { cx . root } >
2325 < Box className = { cx . amountBox } >
@@ -28,6 +30,7 @@ export const SimpleAssetInput = ({
2830 onChange = { ( value ) : void => {
2931 onAmountChange ?.( state . asset , value ) ;
3032 } }
33+ testId = { testId }
3134 />
3235 </ Box >
3336 < Box className = { cx . balance } >
Original file line number Diff line number Diff line change @@ -3,26 +3,21 @@ import type { PropsWithChildren } from 'react';
33
44import PlusSmall from '@icons/PlusSmallComponent' ;
55
6- import { AssetInput } from '../asset-input' ;
6+ import { AssetInput , AssetState , AssetWithFiat } from '../asset-input' ;
77import { Box } from '../box' ;
88import * as ControlButtons from '../control-buttons' ;
99import { Divider } from '../divider' ;
1010
1111import * as cx from './bundle-input.css' ;
1212import { RemoveButton } from './remove-button.component' ;
1313
14- import type { Data } from '../asset-input' ;
15-
1614export type Props = PropsWithChildren < {
17- state ?: Data . AssetState [ ] ;
15+ state ?: AssetState [ ] ;
1816 onAddAsset ?: ( ) => void ;
19- onRemoveAsset ?: ( asset : Readonly < Data . AssetWithFiat > ) => void ;
20- onAmountChange ?: (
21- asset : Readonly < Data . AssetWithFiat > ,
22- amount : string ,
23- ) => void ;
24- onTickerClick ?: ( asset : Readonly < Data . AssetWithFiat > ) => void ;
25- onMaxClick ?: ( asset : Readonly < Data . AssetWithFiat > ) => void ;
17+ onRemoveAsset ?: ( asset : Readonly < AssetWithFiat > ) => void ;
18+ onAmountChange ?: ( asset : Readonly < AssetWithFiat > , amount : string ) => void ;
19+ onTickerClick ?: ( asset : Readonly < AssetWithFiat > ) => void ;
20+ onMaxClick ?: ( asset : Readonly < AssetWithFiat > ) => void ;
2621} > ;
2722
2823export const BundleInput = ( {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export { Divider } from './divider';
66export { Flex } from './flex' ;
77export { Grid , Cell } from './grid' ;
88export { Text } from './text' ;
9- export { AssetInput , SimpleAssetInput } from './asset-input' ;
9+ export * from './asset-input' ;
1010export { BundleInput } from './bundle-input' ;
1111export * as SubNavigation from './sub-navigation' ;
1212export * as NavigationButton from './navigation-buttons' ;
You can’t perform that action at this time.
0 commit comments