chore: only add bottom safe area padding in note view if note is locked

This commit is contained in:
Aman Harwara
2025-05-12 22:10:11 +05:30
parent 4a6a386eda
commit 631facc10e
2 changed files with 8 additions and 2 deletions

View File

@@ -6,9 +6,11 @@ import { useAvailableSafeAreaPadding } from '@/Hooks/useSafeAreaPadding'
export const EditorContentWithSafeAreaPadding = forwardRef(function EditorContentWithSafeAreaPadding(
{
isNoteLocked,
editorLineWidth,
children,
}: {
isNoteLocked: boolean
editorLineWidth: EditorLineWidth
children: NonNullable<ReactNode>
},
@@ -22,7 +24,7 @@ export const EditorContentWithSafeAreaPadding = forwardRef(function EditorConten
className={classNames(
ElementIds.EditorContent,
'z-editor-content overflow-auto sm:[&>*]:mx-[var(--editor-margin)] sm:[&>*]:max-w-[var(--editor-max-width)]',
hasBottomInset && 'pb-safe-bottom',
hasBottomInset && isNoteLocked && 'pb-safe-bottom',
)}
style={
{

View File

@@ -955,7 +955,11 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
</div>
)}
<EditorContentWithSafeAreaPadding editorLineWidth={this.state.editorLineWidth} ref={this.editorContentRef}>
<EditorContentWithSafeAreaPadding
isNoteLocked={this.state.noteLocked}
editorLineWidth={this.state.editorLineWidth}
ref={this.editorContentRef}
>
{editorMode === 'component' && this.state.editorComponentViewer && (
<div className="component-view relative flex-grow">
{this.state.paneGestureEnabled && <div className="absolute left-0 top-0 h-full w-[20px] md:hidden" />}