Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Nicely truncate link title/URL #153

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {
Comment on lines -112 to +114
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required to override existing styles due to specificity

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