Skip to content

Commit

Permalink
Improve comment action
Browse files Browse the repository at this point in the history
  • Loading branch information
electrikmilk committed Apr 26, 2024
1 parent bbfb661 commit 42cfdef
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/actions/comment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {renderActionContent, renderActionHeader} from "~/render";
import {renderActionHeader} from "~/render";
import {actions} from "~/actions";

interface CommentActionParameters {
Expand All @@ -11,14 +11,24 @@ export default {
color: '#ffbf00',
background: '#fbf5e8',
render: (container: HTMLElement, params: CommentActionParameters) => {
container.className += ' sp-comment-action';
container.classList.add('sp-comment-action');

const action = document.createElement('div');
const header = renderActionHeader(actions['comment']);
action.appendChild(header);

const comment = document.createElement('div');
comment.className = 'sp-comment-action-content';

const value = document.createElement('div');
comment.appendChild(value);

value.className = 'sp-scrollable-action-content';
value.innerText = params['WFCommentActionText'] ?? null;
action.appendChild(renderActionContent(value.outerHTML));

action.appendChild(comment);

action.appendChild(document.createElement('br'));

return action;
}
Expand Down
9 changes: 9 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@
border-radius: 0.8rem;
}

.sp-comment-action-content {
font-size: 0.8rem;
border-radius: 0.5rem;
margin-left: 3.5rem;
margin-right: 3.5rem;
width: 90%;
}

.sp-container .card:not(:first-child):not(.sp-linked-action) {
margin-top: 1.6rem;
}
Expand Down Expand Up @@ -287,6 +295,7 @@
height: 5rem;
text-align: left;
min-width: 355px;
width: 100%;
white-space-collapse: break-spaces;
overflow-x: hidden;
overflow-y: auto;
Expand Down

0 comments on commit 42cfdef

Please sign in to comment.