Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
zugdev committed Oct 15, 2024
1 parent 96400e8 commit 7dfa73b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions static/scripts/rewards/render-transaction/render-ens-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ function shortenEnsName(ensName: string): string {
const smallScreenLimit = 20; // max length in chars for small screens
const maxWidth = 570; // width trigger

const parts = ensName.split('.');
const mainPart = parts.slice(0, -1).join('.');
const ending = `.${parts[parts.length - 1]}`;
const parts = ensName.split(".");
const mainPart = parts.slice(0, -1).join(".");
const ending = `.${parts[parts.length - 1]}`;

const maxLength = window.innerWidth >= maxWidth ? largeScreenLimit : smallScreenLimit;

if (ensName.length <= maxLength) return ensName;

const maxMainLength = maxLength - ending.length - 3; // subtract space for '...'

const frontChars = Math.ceil(maxMainLength / 2);
const backChars = maxMainLength - frontChars;

Expand Down

0 comments on commit 7dfa73b

Please sign in to comment.