Skip to content

Commit

Permalink
feat: show comment menu when hover
Browse files Browse the repository at this point in the history
  • Loading branch information
shaokeyibb committed Sep 11, 2024
1 parent 619d5b1 commit b24ffd3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
5 changes: 4 additions & 1 deletion frontend/lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,10 @@ const _renderComments = (comments: Comment[]) => {
const commenter = commentEl.querySelector(
".comment_commenter",
)! as HTMLAnchorElement;
commenter.textContent = comment.commenter.name;
if (comment.commenter.name) {
commenter.textContent = comment.commenter.name;
commenter.title = comment.commenter.name;
}

const userAvatar = commentEl.querySelector(
".comment_user_avatar",
Expand Down
18 changes: 16 additions & 2 deletions frontend/lib/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -331,24 +331,38 @@
}

& .comment_header {
display: flex;
display: grid;
align-items: center;

flex-wrap: wrap;
grid-template-columns: fit-content(40%) max-content auto;

gap: 3px 10px;

font-size: 12px;

user-select: none;

& .comment_commenter {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

& .comment_time {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;

color: var(--review-secondary-text-color);
}

& .comment_actions {
display: none;
}

&:hover .comment_actions {
display: flex;
}
}

& .comment.comment_pending {
Expand Down

0 comments on commit b24ffd3

Please sign in to comment.