Skip to content

Commit 2cc5ff6

Browse files
authored
Makes ui of "to" field on send form clearer (#282)
1 parent cce0d7f commit 2cc5ff6

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

renderer/components/SendAssetsForm/SendAssetsForm.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,13 @@ export function SendAssetsFormContent({
258258
return [...(contacts ?? []), ...(accounts ?? [])];
259259
}, [contactsData, allAccountsData]);
260260

261+
const accountNameInAddressBook = useMemo(() => {
262+
const fullContact = formattedContacts.find(
263+
(contact) => contact.value === toAccountValue,
264+
);
265+
return fullContact?.label.main;
266+
}, [formattedContacts, toAccountValue]);
267+
261268
return (
262269
<>
263270
{syncingMessage}
@@ -312,7 +319,9 @@ export function SendAssetsFormContent({
312319

313320
<Combobox
314321
{...register("toAccount")}
315-
label={formatMessage(messages.toLabel)}
322+
label={`${formatMessage(messages.toLabel)}${
323+
accountNameInAddressBook ? ": " + accountNameInAddressBook : ""
324+
}`}
316325
error={errors.toAccount?.message}
317326
options={formattedContacts}
318327
value={toAccountValue}

renderer/ui/Forms/Combobox/Combobox.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ export const Combobox = forwardRef<HTMLInputElement, Props>(function Combobox(
137137
type="button"
138138
display="block"
139139
w="100%"
140+
background={
141+
option.value === value ? COLORS.GRAY_LIGHT : "transparent"
142+
}
140143
textAlign="left"
141144
onMouseDown={(e) => {
142145
e.preventDefault();

0 commit comments

Comments
 (0)