-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: truncate search item label text
- Loading branch information
Showing
3 changed files
with
38 additions
and
4 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
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
14 changes: 14 additions & 0 deletions
14
src/components/v5/shared/SearchSelect/partials/SearchItemLabelText/index.tsx
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,14 @@ | ||
import React from 'react'; | ||
|
||
import MaskedAddress from '~shared/MaskedAddress/index.ts'; | ||
import { isAddress } from '~utils/web3/index.ts'; | ||
|
||
export const SearchItemLabelText = ({ labelText }: { labelText: string }) => { | ||
const lowerCasedLabelText = labelText.toLowerCase(); | ||
|
||
return isAddress(lowerCasedLabelText) ? ( | ||
<MaskedAddress address={lowerCasedLabelText} /> | ||
) : ( | ||
<>{labelText}</> | ||
); | ||
}; |