11import { TagItem } from "@mutinywallet/mutiny-wasm" ;
2- import { createMemo , Show } from "solid-js" ;
32
4- import receive from "~/assets/icons/receive.svg" ;
5- import send from "~/assets/icons/send.svg" ;
63import { LabelCircle } from "~/components" ;
7- import { useI18n } from "~/i18n/context" ;
84import { PseudoContact } from "~/utils" ;
95
106export function ContactButton ( props : {
117 contact : PseudoContact | TagItem ;
128 onClick : ( ) => void ;
13- inList ?: boolean ;
149} ) {
15- const i18n = useI18n ( ) ;
16-
17- const canSend = createMemo ( ( ) => {
18- return ! ! props . contact . ln_address || ! ! props . contact . lnurl ;
19- } ) ;
20-
2110 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" >
2812 < LabelCircle
2913 name = { props . contact . name }
3014 image_url = { props . contact . primal_image_url }
@@ -36,31 +20,10 @@ export function ContactButton(props: {
3620 < h2 class = "overflow-hidden overflow-ellipsis text-base font-semibold" >
3721 { props . contact . name }
3822 </ 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 || "" }
5225 </ h3 >
5326 </ 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 >
6427 </ div >
6528 ) ;
6629}
0 commit comments