Skip to content

Commit 68846a1

Browse files
committed
frontend: fix tx details behaviour
1. Focus trap to include dialog's header for tx detail dialog. This way, the note input doesn't get auto focused. Also added autofocus inside FOCUSABLE_SELECTOR (useEsc hook) 2. Changed translations: Send to Sent, and Receive to Received
1 parent 8664a07 commit 68846a1

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

frontends/web/src/components/dialog/dialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export const Dialog = ({
165165
className={overlayClass}
166166
>
167167
<UseBackButton handler={closeHandler} />
168-
<div className={modalClass}>
168+
<div className={modalClass} ref={contentRef}>
169169
{title && (
170170
<div className={headerClass}>
171171
<h3 className={style.title}>{title}</h3>
@@ -177,7 +177,7 @@ export const Dialog = ({
177177
)}
178178
</div>
179179
)}
180-
<div className={contentClass} ref={contentRef}>
180+
<div className={contentClass}>
181181
<div className={style.content}>{children}</div>
182182
</div>
183183
</div>

frontends/web/src/components/transactions/components/tx-detail-dialog/tx-detail-dialog.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ export const TxDetailsDialog = ({
8787
title={t('transaction.details.title')}
8888
onClose={onClose}
8989
slim
90-
medium>
90+
medium
91+
>
9192
{transactionInfo && (
9293
<div className={styles.container}>
9394
<TxDetailHeader

frontends/web/src/components/transactions/components/tx-detail-dialog/tx-detail-header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ const StatusAndSign = ({
8888
const fromSignToText = () => {
8989
switch (type) {
9090
case 'send':
91-
return t('generic.send');
91+
return t('generic.sent');
9292
case 'receive':
93-
return t('generic.receiveWithoutCoinCode');
93+
return t('generic.received');
9494
case 'send_to_self':
9595
return t('transaction.details.sendToSelf');
9696
}

frontends/web/src/hooks/keyboard.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ const FOCUSABLE_SELECTOR = `
6060
input:not(:disabled),
6161
select:not(:disabled),
6262
textarea:not(:disabled),
63-
[tabindex]:not([tabindex="-1"]):not(:disabled)
63+
[tabindex]:not([tabindex="-1"]):not(:disabled),
64+
[autofocus]:not(:disabled)
6465
`;
6566

6667
/**

frontends/web/src/locales/en/app.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,7 @@
889889
"receiveWithoutCoinCode": "Receive",
890890
"receive_bitcoin": "Receive Bitcoin",
891891
"receive_crypto": "Receive crypto",
892+
"received": "Received",
892893
"reset": "Reset",
893894
"resetToDefault": "Reset to default",
894895
"search": "Search…",
@@ -897,6 +898,7 @@
897898
"sell_bitcoin": "Sell Bitcoin",
898899
"sell_crypto": "Sell crypto",
899900
"send": "Send",
901+
"sent": "Sent",
900902
"spend_bitcoin": "Spend bitcoin",
901903
"spend_crypto": "Spend crypto"
902904
},

0 commit comments

Comments
 (0)