Skip to content

Commit

Permalink
fix: truncate username full variant text (#1342)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyesp authored Oct 19, 2023
1 parent 3e9177b commit 818d78c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 9 additions & 1 deletion src/components/Common/Username.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
.Username {
.Username--full {
display: flex;
flex-direction: row;
align-items: center;
}

.Username--address {
display: inline;
}

Expand All @@ -18,6 +24,8 @@ a.Username span.address {
.Username .dcl.address,
.Username .Username__Name {
margin-left: 0.5rem;
text-overflow: ellipsis;
overflow: hidden;
}

.Username .dcl.blockie-wrapper .dcl.blockie-children {
Expand Down
6 changes: 4 additions & 2 deletions src/components/Common/Username.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,16 @@ const Username = ({ address, size, linked, variant = UsernameVariant.Full, stron
</>
)

const customClassNames = classNames('Username', `Username--${variant}`, className)

return (
<>
{linked ? (
<Link className={classNames('Username', className)} href={locations.profile({ address: checksumAddress })}>
<Link className={customClassNames} href={locations.profile({ address: checksumAddress })}>
{userElement}
</Link>
) : (
<span className={classNames('Username', className)}>{userElement}</span>
<span className={customClassNames}>{userElement}</span>
)}
</>
)
Expand Down
4 changes: 0 additions & 4 deletions src/components/Delegation/DelegatesTableRow.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
.DelegatesTableRow__Username span {
width: 105px;
text-align: left;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
margin-left: 2px;
}

.DelegatesTableRow__CandidateName {
Expand Down

0 comments on commit 818d78c

Please sign in to comment.