Skip to content

Commit 631facc

Browse files
committed
chore: only add bottom safe area padding in note view if note is locked
1 parent 4a6a386 commit 631facc

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

packages/web/src/javascripts/Components/NoteView/EditorContentWithSafeAreaPadding.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ import { useAvailableSafeAreaPadding } from '@/Hooks/useSafeAreaPadding'
66

77
export const EditorContentWithSafeAreaPadding = forwardRef(function EditorContentWithSafeAreaPadding(
88
{
9+
isNoteLocked,
910
editorLineWidth,
1011
children,
1112
}: {
13+
isNoteLocked: boolean
1214
editorLineWidth: EditorLineWidth
1315
children: NonNullable<ReactNode>
1416
},
@@ -22,7 +24,7 @@ export const EditorContentWithSafeAreaPadding = forwardRef(function EditorConten
2224
className={classNames(
2325
ElementIds.EditorContent,
2426
'z-editor-content overflow-auto sm:[&>*]:mx-[var(--editor-margin)] sm:[&>*]:max-w-[var(--editor-max-width)]',
25-
hasBottomInset && 'pb-safe-bottom',
27+
hasBottomInset && isNoteLocked && 'pb-safe-bottom',
2628
)}
2729
style={
2830
{

packages/web/src/javascripts/Components/NoteView/NoteView.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,11 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
955955
</div>
956956
)}
957957

958-
<EditorContentWithSafeAreaPadding editorLineWidth={this.state.editorLineWidth} ref={this.editorContentRef}>
958+
<EditorContentWithSafeAreaPadding
959+
isNoteLocked={this.state.noteLocked}
960+
editorLineWidth={this.state.editorLineWidth}
961+
ref={this.editorContentRef}
962+
>
959963
{editorMode === 'component' && this.state.editorComponentViewer && (
960964
<div className="component-view relative flex-grow">
961965
{this.state.paneGestureEnabled && <div className="absolute left-0 top-0 h-full w-[20px] md:hidden" />}

0 commit comments

Comments
 (0)