@@ -6,13 +6,13 @@ import {
6
6
Icon ,
7
7
Image ,
8
8
Input ,
9
+ AddressInput ,
9
10
Text ,
10
11
type SnapComponent ,
11
12
} from '@metamask/snaps-sdk/jsx' ;
12
13
13
14
import { AccountSelector } from './AccountSelector' ;
14
15
import btcIcon from '../images/btc.svg' ;
15
- import jazzicon3 from '../images/jazzicon3.svg' ;
16
16
import type { Account , SendFormErrors } from '../types' ;
17
17
18
18
/**
@@ -22,15 +22,13 @@ import type { Account, SendFormErrors } from '../types';
22
22
* @property accounts - The available accounts.
23
23
* @property errors - The form errors.
24
24
* @property selectedCurrency - The selected currency to display.
25
- * @property displayClearIcon - Whether to display the clear icon or not.
26
25
* @property flushToAddress - Whether to flush the address field or not.
27
26
*/
28
27
export type SendFormProps = {
29
28
selectedAccount : string ;
30
29
accounts : Account [ ] ;
31
30
errors ?: SendFormErrors ;
32
31
selectedCurrency : 'BTC' | '$' ;
33
- displayClearIcon : boolean ;
34
32
flushToAddress ?: boolean ;
35
33
} ;
36
34
@@ -42,7 +40,6 @@ export type SendFormProps = {
42
40
* @param props.accounts - The available accounts.
43
41
* @param props.errors - The form errors.
44
42
* @param props.selectedCurrency - The selected currency to display.
45
- * @param props.displayClearIcon - Whether to display the clear icon or not.
46
43
* @param props.flushToAddress - Whether to flush the address field or not.
47
44
* @returns The SendForm component.
48
45
*/
@@ -51,7 +48,6 @@ export const SendForm: SnapComponent<SendFormProps> = ({
51
48
accounts,
52
49
errors,
53
50
selectedCurrency,
54
- displayClearIcon,
55
51
flushToAddress,
56
52
} ) => (
57
53
< Form name = "sendForm" >
@@ -69,21 +65,12 @@ export const SendForm: SnapComponent<SendFormProps> = ({
69
65
</ Box >
70
66
</ Field >
71
67
< Field label = "To account" error = { errors ?. to } >
72
- < Box >
73
- < Image src = { jazzicon3 } />
74
- </ Box >
75
- < Input
68
+ < AddressInput
76
69
name = "to"
70
+ chainId = "eip155:0"
77
71
placeholder = "Enter receiving address"
78
72
value = { flushToAddress ? '' : undefined }
79
73
/>
80
- { displayClearIcon && (
81
- < Box >
82
- < Button name = "clear" >
83
- < Icon name = "close" color = "primary" />
84
- </ Button >
85
- </ Box >
86
- ) }
87
74
</ Field >
88
75
</ Form >
89
76
) ;
0 commit comments