Adds a 60px area to the left and right of editable area (#5197

* Adds a 60px area to the left and right of editable area that allows clicking to focus paragraphs

* tsc
This commit is contained in:
Tom Moor
2023-04-13 22:24:33 -04:00
committed by GitHub
parent 515f5e8e73
commit 169a99f21e
5 changed files with 23 additions and 8 deletions

View File

@@ -25,7 +25,7 @@ import EditableTitle from "./EditableTitle";
const extensions = withComments(richExtensions);
type Props = Omit<EditorProps, "extensions"> & {
type Props = Omit<EditorProps, "extensions" | "editorStyle"> & {
onChangeTitle: (text: string) => void;
id: string;
document: Document;
@@ -189,12 +189,18 @@ function DocumentEditor(props: Props, ref: React.RefObject<any>) {
: undefined
}
onDeleteCommentMark={
team?.getPreference(TeamPreference.Commenting)
team?.getPreference(TeamPreference.Commenting) && can.comment
? handleRemoveComment
: undefined
}
extensions={extensions}
bottomPadding={`calc(50vh - ${childRef.current?.offsetHeight || 0}px)`}
editorStyle={{
padding: "0 60px",
margin: "0 -60px",
paddingBottom: `calc(50vh - ${
childRef.current?.offsetHeight || 0
}px)`,
}}
{...rest}
/>
<div ref={childRef}>{children}</div>