Skip to content

Commit

Permalink
fix(address): fix the nrc721 not displayed in the assets list (#289)
Browse files Browse the repository at this point in the history
* fix(address): fix the nrc721 not displayed in the assets list

* style(address_udt): use ellipsis

* fix(address): ellipsis

---------

Co-authored-by: Chen Yu <keithwhisper@gmail.com>
  • Loading branch information
Daryl-L and Keith-CY authored May 11, 2024
1 parent 094a5b4 commit bcda583
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/pages/Address/AddressComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import {
AddressSporeComp,
AddressSudtComp,
AddressXudtComp,
AddressNRC721Comp,
} from './AddressAssetComp'

enum AssetInfo {
Expand Down Expand Up @@ -267,6 +268,8 @@ export const AddressOverviewCard: FC<{ address: Address }> = ({ address }) => {

case 'm_nft_token':
return <AddressMNFTComp account={udt} key={udt.symbol + udt.udtType + udt.amount} />
case 'nrc_721_token':
return <AddressNRC721Comp account={udt} key={udt.symbol + udt.udtType + udt.amount} />
default:
return null
}
Expand Down
6 changes: 5 additions & 1 deletion src/pages/Address/addressAssetComp.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
background: #fff;
border-radius: 4px;
overflow: hidden;
max-width: 287px;

.head {
display: flex;
Expand Down Expand Up @@ -39,7 +40,9 @@
}

.attribute {
display: flex;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.copy {
Expand All @@ -62,6 +65,7 @@
}

.fields {
min-width: 0;
display: flex;
flex-direction: column;
justify-content: space-around;
Expand Down
3 changes: 2 additions & 1 deletion src/utils/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,5 @@ export const handleBigNumberFloor = (value: BigNumber | string | number, decimal
return `${parseFloorDecimal(bigValue, decimal)}`
}

export const sliceNftName = (name?: string) => (name && name.length > 32 ? `${name.slice(0, 32)}...` : name)
export const sliceNftName = (name?: string, maxLength = 32) =>
name && name.length > maxLength ? `${name.slice(0, maxLength)}...` : name

0 comments on commit bcda583

Please sign in to comment.