Skip to content

Commit 55ac0ce

Browse files
committed
style-modal
1 parent 8b9f4a2 commit 55ac0ce

File tree

4 files changed

+64
-13
lines changed

4 files changed

+64
-13
lines changed

src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteEditor.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { useCreateBlockNote } from '@blocknote/react';
1313
import { HocuspocusProvider } from '@hocuspocus/provider';
1414
import { useEffect } from 'react';
1515
import { useTranslation } from 'react-i18next';
16+
import { css } from 'styled-components';
1617
import * as Y from 'yjs';
1718

1819
import { Box, TextErrors } from '@/components';
@@ -33,7 +34,7 @@ import { randomColor } from '../utils';
3334

3435
import { BlockNoteSuggestionMenu } from './BlockNoteSuggestionMenu';
3536
import { BlockNoteToolbar } from './BlockNoteToolBar/BlockNoteToolbar';
36-
import { useComments } from './comments/useComments';
37+
import { cssComments, useComments } from './comments/';
3738
import {
3839
AccessibleImageBlock,
3940
CalloutBlock,
@@ -200,7 +201,10 @@ export const BlockNoteEditor = ({ doc, provider }: BlockNoteEditorProps) => {
200201
<Box
201202
$padding={{ top: 'md' }}
202203
$background="white"
203-
$css={cssEditor(readOnly, canSeeComment)}
204+
$css={css`
205+
${cssEditor(readOnly)};
206+
${cssComments(canSeeComment)}
207+
`}
204208
className="--docs--editor-container"
205209
>
206210
{errorAttachment && (
@@ -255,7 +259,10 @@ export const BlockNoteEditorVersion = ({
255259

256260
return (
257261
<Box
258-
$css={cssEditor(readOnly, canSeeComment)}
262+
$css={css`
263+
${cssEditor(readOnly)};
264+
${cssComments(canSeeComment)}
265+
`}
259266
className="--docs--editor-container"
260267
>
261268
<BlockNoteView
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './styles';
2+
export * from './useComments';
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { css } from 'styled-components';
2+
3+
export const cssComments = (canSeeComment: boolean) => css`
4+
& .--docs--main-editor,
5+
& .--docs--main-editor .ProseMirror {
6+
.bn-editor {
7+
.bn-thread-mark:not([data-orphan='true']),
8+
.bn-thread-mark-selected:not([data-orphan='true']) {
9+
background: ${canSeeComment ? '#F4D261' : 'transparent'};
10+
color: var(--c--theme--colors--greyscale-700);
11+
}
12+
}
13+
14+
.bn-thread {
15+
max-width: 400px;
16+
width: 100%;
17+
padding: 0.4rem;
18+
19+
.bn-thread-comment {
20+
padding: 1rem;
21+
22+
&:hover,
23+
&:hover .bn-editor {
24+
background-color: #fafafa;
25+
}
26+
27+
.mantine-Group-root {
28+
right: 0.3rem !important;
29+
top: 0.3rem !important;
30+
31+
.bn-comment-actions {
32+
background: transparent;
33+
border: none;
34+
35+
.mantine-Button-root {
36+
background-color: transparent;
37+
38+
&:hover {
39+
background-color: var(--c--theme--colors--greyscale-100);
40+
}
41+
}
42+
}
43+
44+
& svg {
45+
color: var(--c--theme--colors--info-600);
46+
}
47+
}
48+
}
49+
}
50+
}
51+
`;

src/frontend/apps/impress/src/features/docs/doc-editor/styles.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { css } from 'styled-components';
22

3-
export const cssEditor = (readonly: boolean, canSeeComment: boolean) => css`
3+
export const cssEditor = (readonly: boolean) => css`
44
& {
55
height: 100%;
66
padding-bottom: 2rem;
@@ -124,15 +124,6 @@ export const cssEditor = (readonly: boolean, canSeeComment: boolean) => css`
124124
border-left: 4px solid var(--c--theme--colors--greyscale-300);
125125
font-style: italic;
126126
}
127-
128-
/**
129-
* Comments
130-
*/
131-
.bn-thread-mark:not([data-orphan='true']),
132-
.bn-thread-mark-selected:not([data-orphan='true']) {
133-
background: ${canSeeComment ? '#F4D261' : 'transparent'};
134-
color: var(--c--theme--colors--greyscale-700);
135-
}
136127
}
137128
138129
& .bn-block-outer:not(:first-child) {

0 commit comments

Comments
 (0)