Skip to content

Commit

Permalink
Merge pull request #3096 from metabrainz/ansh/fix-playlist-seach
Browse files Browse the repository at this point in the history
fix: Render Annotations for Playlist on Search page
  • Loading branch information
anshg1214 authored Jan 8, 2025
2 parents 31a9324 + 04c5eaf commit 03cab35
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
13 changes: 0 additions & 13 deletions frontend/css/listens-page.less
Original file line number Diff line number Diff line change
Expand Up @@ -505,19 +505,6 @@
}
}

.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ellipsis-2-lines {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}

#spacer {
margin-top: 54px;
}
Expand Down
1 change: 1 addition & 0 deletions frontend/css/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
@import "donations.less";
@import "scroll-container.less";
@import "flairs.less";
@import "utilities.less";

@icon-font-path: "/static/fonts/";

Expand Down
20 changes: 20 additions & 0 deletions frontend/css/utilities.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ellipsis-2-lines {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}

.ellipsis-4-lines {
display: -webkit-box;
-webkit-line-clamp: 4;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
8 changes: 7 additions & 1 deletion frontend/js/src/search/PlaylistSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,13 @@ export default function PlaylistSearch(props: PlayListSearchProps) {
{playlist.title}
</Link>
</td>
<td>{playlist?.annotation}</td>
<td
className="ellipsis-4-lines"
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: playlist?.annotation || "",
}}
/>
<td>
<Link
to={`https://musicbrainz.org/user/${playlist?.creator}`}
Expand Down

0 comments on commit 03cab35

Please sign in to comment.