diff --git a/explorer/src/lib/components/list-item/ListItem.css b/explorer/src/lib/components/list-item/ListItem.css
index c468d1cc58..3ba867c58d 100644
--- a/explorer/src/lib/components/list-item/ListItem.css
+++ b/explorer/src/lib/components/list-item/ListItem.css
@@ -31,6 +31,7 @@
gap: 0.625rem;
align-items: center;
margin-bottom: 1.25rem;
+ line-break: anywhere;
}
.details-list__definition:last-of-type {
diff --git a/explorer/src/lib/components/transaction-type/TransactionType.svelte b/explorer/src/lib/components/transaction-type/TransactionType.svelte
index 116d0cec2a..f1fa5c1fea 100644
--- a/explorer/src/lib/components/transaction-type/TransactionType.svelte
+++ b/explorer/src/lib/components/transaction-type/TransactionType.svelte
@@ -7,6 +7,8 @@
/** @type {boolean} */
export let displayTooltips = false;
+
+ const BADGE_TEXT_MAX_LENGTH = 20;
@@ -22,5 +24,5 @@
: mdiShieldOutline}
size="large"
/>
-
+
diff --git a/explorer/src/lib/dusk/components/__tests__/Badge.spec.js b/explorer/src/lib/dusk/components/__tests__/Badge.spec.js
index 7c2194254e..6d7f43e225 100644
--- a/explorer/src/lib/dusk/components/__tests__/Badge.spec.js
+++ b/explorer/src/lib/dusk/components/__tests__/Badge.spec.js
@@ -44,4 +44,14 @@ describe("Badge", () => {
expect(container.firstChild).toMatchSnapshot();
});
+
+ it("should only display a string 10 characters long", () => {
+ const props = {
+ ...baseProps,
+ maxlength: 10,
+ text: "ABCDEFGHIJK",
+ };
+ const { container } = render(Badge, { ...props });
+ expect(container.firstChild?.textContent?.length).toBe(10);
+ });
});
diff --git a/explorer/src/lib/dusk/components/badge/Badge.svelte b/explorer/src/lib/dusk/components/badge/Badge.svelte
index ebdfffa452..0dbfdd397b 100644
--- a/explorer/src/lib/dusk/components/badge/Badge.svelte
+++ b/explorer/src/lib/dusk/components/badge/Badge.svelte
@@ -10,6 +10,9 @@
/** @type {String | Undefined} */
export let className = undefined;
+ /** @type {number | Undefined} */
+ export let maxlength = undefined;
+
$: classes = makeClassName([
"dusk-badge",
`dusk-badge--variant-${variant}`,
@@ -17,4 +20,4 @@
]);
-{text}
+{text.substring(0, maxlength)}