1
1
import { TagItem } from "@mutinywallet/mutiny-wasm" ;
2
- import { createMemo , Show } from "solid-js" ;
3
2
4
- import receive from "~/assets/icons/receive.svg" ;
5
- import send from "~/assets/icons/send.svg" ;
6
3
import { LabelCircle } from "~/components" ;
7
- import { useI18n } from "~/i18n/context" ;
8
4
import { PseudoContact } from "~/utils" ;
9
5
10
6
export function ContactButton ( props : {
11
7
contact : PseudoContact | TagItem ;
12
8
onClick : ( ) => void ;
13
- inList ?: boolean ;
14
9
} ) {
15
- const i18n = useI18n ( ) ;
16
-
17
- const canSend = createMemo ( ( ) => {
18
- return ! ! props . contact . ln_address || ! ! props . contact . lnurl ;
19
- } ) ;
20
-
21
10
return (
22
- < div
23
- class = "flex items-center gap-2"
24
- classList = { {
25
- "text-white/20 opacity-60" : ! canSend ( )
26
- } }
27
- >
11
+ < div class = "flex items-center gap-2" >
28
12
< LabelCircle
29
13
name = { props . contact . name }
30
14
image_url = { props . contact . primal_image_url }
@@ -36,31 +20,10 @@ export function ContactButton(props: {
36
20
< h2 class = "overflow-hidden overflow-ellipsis text-base font-semibold" >
37
21
{ props . contact . name }
38
22
</ h2 >
39
- < h3
40
- class = "overflow-hidden overflow-ellipsis text-left text-xs font-normal"
41
- classList = { {
42
- "text-m-grey-400" : canSend ( ) ,
43
- "text-m-grey-700" : ! canSend ( )
44
- } }
45
- >
46
- { props . contact . ln_address ||
47
- props . contact . lnurl
48
- ?. toLowerCase ( )
49
- . substring ( 0 , 15 )
50
- . concat ( "..." ) ||
51
- i18n . t ( "send.no_payment_info" ) }
23
+ < h3 class = "overflow-hidden overflow-ellipsis text-left text-xs font-normal text-m-grey-400" >
24
+ { props . contact . ln_address || "" }
52
25
</ h3 >
53
26
</ div >
54
- < Show when = { canSend ( ) && props . inList } >
55
- < div class = "flex gap-2" >
56
- < button onClick = { ( ) => { } } >
57
- < img src = { send } width = { "24px" } height = { "24px" } />
58
- </ button >
59
- < button >
60
- < img src = { receive } width = { "24px" } height = { "24px" } />
61
- </ button >
62
- </ div >
63
- </ Show >
64
27
</ div >
65
28
) ;
66
29
}
0 commit comments