Skip to content

Commit 90171bb

Browse files
author
lukaw3d
committed
Explain unknown tx status as encrypted
Before status icon makeover we had a keylock icon for unknown status. This indicated it was related to transaction being encrypted. But lucide-react doesn't have a lock-in-a-circle icon that would appear consistent with others, so add a message instead.
1 parent ce99e1a commit 90171bb

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/app/components/StatusIcon/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ const getPendingLabel = (t: TFunction, method: string | undefined, withText?: bo
9999
return t('transaction.startedDescription', { method: translatedMethod })
100100
}
101101

102+
const getUnknownLabel = (t: TFunction, withText?: boolean) => {
103+
if (withText) {
104+
return t('common.unknown')
105+
}
106+
return t('transaction.tooltips.statusEncrypted')
107+
}
108+
102109
export const StatusIcon: FC<StatusIconProps> = ({ success, error, withText, method }) => {
103110
const { t } = useTranslation()
104111
const status: TxStatus =
@@ -110,7 +117,7 @@ export const StatusIcon: FC<StatusIconProps> = ({ success, error, withText, meth
110117
? 'success'
111118
: 'failure'
112119
const statusLabel: Record<TxStatus, string> = {
113-
unknown: t('common.unknown'),
120+
unknown: getUnknownLabel(t, withText),
114121
success: t('common.success'),
115122
failure: t('common.failed'),
116123
pending: getPendingLabel(t, method, withText),
@@ -133,6 +140,7 @@ export const StatusIcon: FC<StatusIconProps> = ({ success, error, withText, meth
133140
</div>
134141
{errorMessage && <StatusDetails error>{errorMessage}</StatusDetails>}
135142
{!errorMessage && status === 'pending' && <StatusDetails>{getPendingLabel(t, method)}</StatusDetails>}
143+
{status === 'unknown' && <StatusDetails>{getUnknownLabel(t)}</StatusDetails>}
136144
</>
137145
)
138146
} else {

src/locales/en/translation.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@
541541
"started": "Started",
542542
"startedDescription": "{{ method }} has started, final result will be known in the next block",
543543
"tooltips": {
544+
"statusEncrypted": "Status is encrypted.",
544545
"txEncrypted": "This transaction is encrypted.",
545546
"txNotEncrypted": "This transaction is <strong>not</strong> encrypted."
546547
},

0 commit comments

Comments
 (0)