Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Commit 59b1970

Browse files
committed
simplify search items
1 parent 2c8f6c1 commit 59b1970

File tree

2 files changed

+3
-41
lines changed

2 files changed

+3
-41
lines changed

src/components/ActualSearch.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ export function ActualSearch(props: { initialValue?: string }) {
279279
<ContactButton
280280
contact={contact}
281281
onClick={() => sendToContact(contact)}
282-
inList
283282
/>
284283
)}
285284
</For>

src/components/ContactButton.tsx

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,14 @@
11
import { 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";
63
import { LabelCircle } from "~/components";
7-
import { useI18n } from "~/i18n/context";
84
import { PseudoContact } from "~/utils";
95

106
export 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

Comments
 (0)