Skip to content

Commit

Permalink
FIX Nicely truncate link title/URL (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Jan 8, 2024
1 parent 80b0867 commit bdf0b36
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 10 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/styles/bundle.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 30 additions & 5 deletions client/src/components/LinkPicker/LinkPicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,13 @@
align-items: center;
flex-grow: 1;
height: 100%;
min-width: 0;
text-align: left;
border: none;
margin-right: 0;
&::before {

&[class*="font-icon-"]::before {
position: absolute;
font-size: 1.231rem;
padding: .76925rem;
margin-right: 6px;
Expand All @@ -119,6 +122,8 @@

.link-picker__link-detail {
flex-grow: 1;
width: 100%;
padding-left: 3.5rem;
}

.link-picker__clear {
Expand All @@ -129,12 +134,32 @@
color: $link-color;
}

%cutoff-text {
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.link-picker__title {
display: flex;
align-items: center;
width: 100%;

.badge {
color: #cf3f00;
background-color: #fff2ea;
padding: 2px 3px 2px 4px;
}
}

.link-picker__title-text {
min-width: 0;
margin-right: 5px;
@extend %cutoff-text;
}

.link-picker__title .badge {
color: #cf3f00;
background-color: #fff2ea;
padding: 2px 3px 2px 4px;
.link-picker__type {
width: 100%;
@extend %cutoff-text;
}
3 changes: 0 additions & 3 deletions client/src/components/LinkPicker/LinkPickerTitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ const LinkPickerTitle = ({
if (versionState) {
classes[` link-picker__link--${versionState}`] = true;
}
if (title && title.length > 25) {
title = title.substring(0, 25) + '...';
}
const className = classnames(classes);
return <div className={className}>
<Button className="link-picker__button font-icon-link" color="secondary" onClick={stopPropagation(onClick)}>
Expand Down

0 comments on commit bdf0b36

Please sign in to comment.