Skip to content

Commit

Permalink
🐛(lld) hedera split address
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasWerey committed Nov 15, 2024
1 parent 8165e1b commit 5da329a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/rotten-lamps-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": patch
---

Fix split address that didn't care about special characters
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,18 @@ export const SplitAddress = ({
ff,
fontSize,
};
const third = Math.round(value.length / 3);

// FIXME why not using CSS for this? meaning we might be able to have a left & right which both take 50% & play with overflow & text-align
const left = value.slice(0, third);
const right = value.slice(third, value.length);
let left, right;
if (value.includes(".")) {
const parts = value.split(".");
left = parts[0] + ".";
right = parts.slice(1).join(".");
} else {
const third = Math.round(value.length / 3);
left = value.slice(0, third);
right = value.slice(third, value.length);
}
return (
<Box horizontal {...boxProps}>
<Left>{left}</Left>
Expand Down

0 comments on commit 5da329a

Please sign in to comment.