File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
web/src/pages/Courts/CourtDetails/StakingHistoryByCourt/DisplayStakes/StakeEventCard Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -46,16 +46,13 @@ const StyledLabel = styled.label`
4646` ;
4747
4848const StakeLabel = styled ( StyledLabel ) `
49- width: 90px ;
49+ width: 80px ;
5050 text-align: right;
5151` ;
5252
5353const CourtLabelContainer = styled . div `
54- width: 110px ;
54+ width: 120px ;
5555 text-align: right;
56- overflow: hidden;
57- text-overflow: ellipsis;
58- white-space: nowrap;
5956 flex-shrink: 0;
6057` ;
6158
@@ -67,6 +64,10 @@ const CourtLink = styled(InternalLink)`
6764 overflow: hidden;
6865 text-overflow: ellipsis;
6966 white-space: nowrap;
67+
68+ :hover {
69+ color: ${ ( { theme } ) => theme . primaryBlue } ;
70+ }
7071` ;
7172
7273const CourtText = styled . span `
@@ -115,6 +116,11 @@ const formatDate = (timestamp: string): string => {
115116 } ) ;
116117} ;
117118
119+ const truncateCourtName = ( name : string , maxLength : number = 15 ) : string => {
120+ if ( name . length <= maxLength ) return name ;
121+ return name . slice ( 0 , maxLength - 3 ) + "..." ;
122+ } ;
123+
118124const DesktopCard : React . FC < IDesktopCard > = ( {
119125 address,
120126 stake,
@@ -134,10 +140,10 @@ const DesktopCard: React.FC<IDesktopCard> = ({
134140 < StakeLabel > { formatPNK ( BigInt ( stake ) ) } </ StakeLabel >
135141 < CourtLabelContainer >
136142 { isCurrentCourt ? (
137- < CourtText title = { courtName } > { courtName } </ CourtText >
143+ < CourtText title = { courtName } > { truncateCourtName ( courtName ) } </ CourtText >
138144 ) : (
139145 < CourtLink to = { `/courts/${ courtId } ` } title = { courtName } >
140- { courtName }
146+ { truncateCourtName ( courtName ) }
141147 </ CourtLink >
142148 ) }
143149 </ CourtLabelContainer >
You can’t perform that action at this time.
0 commit comments