Skip to content

Commit 1271af5

Browse files
committed
Style comments sidebar for editor context
Use borders instead of shadows for threads and allow the new topic button to be restyled via className prop. Review components use CSS custom properties so the editor can override appearance without direct CSS coupling. REDMINE-21261
1 parent c7348b3 commit 1271af5

6 files changed

Lines changed: 22 additions & 6 deletions

File tree

entry_types/scrolled/package/src/editor/views/ContentElementCommentsView.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export const ContentElementCommentsView = Marionette.ItemView.extend({
2020
ReactDOM.render(
2121
<ReviewStateProvider initialState={session.state}>
2222
<ThreadList subjectType="ContentElement"
23-
subjectId={this.model.get('permaId')} />
23+
subjectId={this.model.get('permaId')}
24+
newTopicButtonClassName={styles.newTopicButton} />
2425
</ReviewStateProvider>,
2526
this.$el.find(`.${styles.container}`)[0]
2627
);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
11
.container {
2+
position: relative;
3+
padding-top: space(4);
4+
--review-thread-box-shadow: none;
5+
--review-thread-border: 1px solid var(--ui-on-surface-color-lightest);
6+
}
7+
8+
.newTopicButton {
9+
composes: secondaryIconButton from './buttons.module.css';
10+
display: flex !important;
11+
position: absolute;
12+
right: 0;
13+
bottom: 100%;
214
}

entry_types/scrolled/package/src/review/NewThreadForm.module.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
padding: space(3);
66
background: var(--ui-surface-color);
77
border-radius: rounded(lg);
8-
box-shadow: var(--ui-box-shadow);
8+
box-shadow: var(--review-thread-box-shadow, var(--ui-box-shadow));
9+
border: var(--review-thread-border, none);
910
}
1011

1112
.input {

entry_types/scrolled/package/src/review/Thread.module.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
padding: space(3);
77
background: var(--ui-surface-color);
88
border-radius: rounded(lg);
9-
box-shadow: var(--ui-box-shadow);
9+
box-shadow: var(--review-thread-box-shadow, var(--ui-box-shadow));
10+
border: var(--review-thread-border, none);
1011
}
1112

1213
.chevronButton {

entry_types/scrolled/package/src/review/ThreadList.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {NewThreadForm} from './NewThreadForm';
99
import NewTopicIcon from './images/newTopic.svg';
1010
import styles from './ThreadList.module.css';
1111

12-
export function ThreadList({subjectType, subjectId, showNewForm: showNewFormProp, reversed, onDismiss}) {
12+
export function ThreadList({subjectType, subjectId, showNewForm: showNewFormProp, reversed, onDismiss, newTopicButtonClassName}) {
1313
const {t} = useI18n({locale: 'ui'});
1414
const threads = useCommentThreads(subjectType, subjectId);
1515
const [expandedThreadId, setExpandedThreadId] = useState(null);
@@ -24,7 +24,8 @@ export function ThreadList({subjectType, subjectId, showNewForm: showNewFormProp
2424
<div className={styles.container}>
2525
{!showNewForm &&
2626
<button className={classNames(styles.newTopicButton,
27-
{[styles.reversed]: reversed})}
27+
newTopicButtonClassName,
28+
{[styles.reversed]: reversed})}
2829
onClick={() => setFormToggled(true)}
2930
aria-label={t('pageflow_scrolled.review.new_topic')}>
3031
<NewTopicIcon />

entry_types/scrolled/package/src/review/ThreadList.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
background: var(--ui-surface-color);
1717
border: 0;
1818
border-radius: rounded();
19-
box-shadow: var(--ui-box-shadow);
19+
box-shadow: var(--review-thread-box-shadow, var(--ui-box-shadow));
2020
padding: space(1.5) space(2);
2121
cursor: pointer;
2222
}

0 commit comments

Comments
 (0)