-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Update account details in ConnectOverlay
- Loading branch information
1 parent
a65faff
commit 85091c5
Showing
7 changed files
with
117 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Truncates a given string to a specified length by replacing the middle portion with ellipses. | ||
* @param str - The string to truncate. | ||
* @param startIndex - The starting index of the middle portion to replace with ellipses. | ||
* @param endIndex - The ending index of the middle portion to replace with ellipses. | ||
* @returns The truncated string. | ||
*/ | ||
export const truncateText = ( | ||
str: string | null, | ||
startIndex: number, | ||
endIndex: number | ||
) => { | ||
const text = String(str); | ||
const firstHalf = text.slice(0, startIndex); | ||
const secondHalf = text.slice(text.length - endIndex); | ||
return `${firstHalf}...${secondHalf}`; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters