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 {
10
10
onChange ?: ( value : string ) => void ;
11
11
value ?: string ;
12
12
id : string ;
13
+ testId ?: string ;
13
14
}
14
15
15
16
export const AmountInput = ( {
16
17
alignment = 'right' ,
17
18
onChange,
18
19
value,
19
20
id,
21
+ testId,
20
22
} : Readonly < Props > ) : JSX . Element => {
21
23
return (
22
24
< Box className = { cx . amountInputSizer } data-value = { value } >
@@ -26,7 +28,7 @@ export const AmountInput = ({
26
28
size = { 1 }
27
29
onChange = { ( { target } ) : void => onChange ?.( target . value ) }
28
30
placeholder = "0.0"
29
- data-testid = { `asset-input-amount-input-${ id } ` }
31
+ data-testid = { testId ?? `asset-input-amount-input-${ id } ` }
30
32
/>
31
33
</ Box >
32
34
) ;
Original file line number Diff line number Diff line change 1
1
export { AssetInput } from './asset-input.component' ;
2
2
export { 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 {
12
12
state : AssetState < Asset > ;
13
13
balanceLabel : string ;
14
14
onAmountChange ?: ( asset : Readonly < Asset > , amount : string ) => void ;
15
+ testId ?: string ;
15
16
}
16
17
17
18
export const SimpleAssetInput = ( {
18
19
state,
19
20
balanceLabel,
20
21
onAmountChange,
22
+ testId,
21
23
} : Readonly < Props > ) : JSX . Element => (
22
24
< div className = { cx . root } >
23
25
< Box className = { cx . amountBox } >
@@ -28,6 +30,7 @@ export const SimpleAssetInput = ({
28
30
onChange = { ( value ) : void => {
29
31
onAmountChange ?.( state . asset , value ) ;
30
32
} }
33
+ testId = { testId }
31
34
/>
32
35
</ Box >
33
36
< Box className = { cx . balance } >
Original file line number Diff line number Diff line change @@ -3,26 +3,21 @@ import type { PropsWithChildren } from 'react';
3
3
4
4
import PlusSmall from '@icons/PlusSmallComponent' ;
5
5
6
- import { AssetInput } from '../asset-input' ;
6
+ import { AssetInput , AssetState , AssetWithFiat } from '../asset-input' ;
7
7
import { Box } from '../box' ;
8
8
import * as ControlButtons from '../control-buttons' ;
9
9
import { Divider } from '../divider' ;
10
10
11
11
import * as cx from './bundle-input.css' ;
12
12
import { RemoveButton } from './remove-button.component' ;
13
13
14
- import type { Data } from '../asset-input' ;
15
-
16
14
export type Props = PropsWithChildren < {
17
- state ?: Data . AssetState [ ] ;
15
+ state ?: AssetState [ ] ;
18
16
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 ;
26
21
} > ;
27
22
28
23
export const BundleInput = ( {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export { Divider } from './divider';
6
6
export { Flex } from './flex' ;
7
7
export { Grid , Cell } from './grid' ;
8
8
export { Text } from './text' ;
9
- export { AssetInput , SimpleAssetInput } from './asset-input' ;
9
+ export * from './asset-input' ;
10
10
export { BundleInput } from './bundle-input' ;
11
11
export * as SubNavigation from './sub-navigation' ;
12
12
export * as NavigationButton from './navigation-buttons' ;
You can’t perform that action at this time.
0 commit comments