Skip to content

Commit 40a6c6c

Browse files
Merge pull request #2864 from OneCommunityGlobal/Sai_Preetham_Name_Overflow_On_Dashboard
Sai_Preetham_Name_Overflow_On_Dashboard
2 parents f4e6452 + 6f45658 commit 40a6c6c

2 files changed

Lines changed: 62 additions & 2 deletions

File tree

src/components/SummaryBar/SummaryBar.css

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,47 @@
166166
opacity: 0.4;
167167
filter: alpha(opacity=40); /* msie */
168168
}
169+
.name-segment {
170+
display: block;
171+
white-space: nowrap;
172+
overflow: hidden;
173+
text-overflow: ellipsis;
174+
font-size: 1.2rem;
175+
margin-bottom: 2px;
176+
}
177+
178+
@media (min-width: 992px) {
179+
.name-segment {
180+
max-width: 21ch;
181+
}
182+
183+
.name-segment:first-child {
184+
max-width: 14ch;
185+
}
186+
187+
.name-segment:nth-child(2) {
188+
display: block;
189+
max-width: 14ch;
190+
overflow: hidden;
191+
text-overflow: ellipsis;
192+
}
193+
194+
.name-segment:nth-child(3) {
195+
display: block;
196+
max-width: 14ch;
197+
overflow: hidden;
198+
text-overflow: ellipsis;
199+
}
200+
201+
.name-segment::after {
202+
content: '';
203+
visibility: hidden;
204+
}
205+
206+
.name-segment:hover::after {
207+
visibility: hidden;
208+
}
209+
}
169210

170211
/* Custom media query for screen widths between 1200px and 1330px */
171212
@media (min-width: 1200px) and (max-width: 1330px) {

src/components/SummaryBar/SummaryBar.jsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,27 @@ function SummaryBar(props) {
541541
</font>
542542
<CardTitle className={`align-middle ${darkMode ? 'text-light' : 'text-dark'}`} tag="h3">
543543
<div className="font-weight-bold">
544-
{userProfile?.firstName || displayUserProfile.firstName}{' '}
545-
{userProfile?.lastName || displayUserProfile.lastName}
544+
<span
545+
className="name-segment"
546+
title={userProfile?.firstName || displayUserProfile.firstName}
547+
>
548+
{(userProfile?.firstName || displayUserProfile.firstName).split(' ')[0]}
549+
</span>
550+
<span
551+
className="name-segment"
552+
title={userProfile?.firstName || displayUserProfile.firstName}
553+
>
554+
{(userProfile?.firstName || displayUserProfile.firstName)
555+
.split(' ')
556+
.slice(1)
557+
.join(' ')}
558+
</span>
559+
<span
560+
className="name-segment"
561+
title={userProfile?.lastName || displayUserProfile.lastName}
562+
>
563+
{userProfile?.lastName || displayUserProfile.lastName}
564+
</span>
546565
</div>
547566
</CardTitle>
548567
</div>

0 commit comments

Comments
 (0)