Skip to content

Commit e67c533

Browse files
committed
chore: fix table a bit
1 parent e6b8207 commit e67c533

File tree

1 file changed

+13
-7
lines changed
  • web/src/pages/Courts/CourtDetails/StakingHistoryByCourt/DisplayStakes/StakeEventCard

1 file changed

+13
-7
lines changed

web/src/pages/Courts/CourtDetails/StakingHistoryByCourt/DisplayStakes/StakeEventCard/DesktopCard.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,13 @@ const StyledLabel = styled.label`
4646
`;
4747

4848
const StakeLabel = styled(StyledLabel)`
49-
width: 90px;
49+
width: 80px;
5050
text-align: right;
5151
`;
5252

5353
const 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

7273
const 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+
118124
const 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>

0 commit comments

Comments
 (0)