chore: only add bottom safe area padding in note view if note is locked
This commit is contained in:
@@ -6,9 +6,11 @@ import { useAvailableSafeAreaPadding } from '@/Hooks/useSafeAreaPadding'
|
|||||||
|
|
||||||
export const EditorContentWithSafeAreaPadding = forwardRef(function EditorContentWithSafeAreaPadding(
|
export const EditorContentWithSafeAreaPadding = forwardRef(function EditorContentWithSafeAreaPadding(
|
||||||
{
|
{
|
||||||
|
isNoteLocked,
|
||||||
editorLineWidth,
|
editorLineWidth,
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
|
isNoteLocked: boolean
|
||||||
editorLineWidth: EditorLineWidth
|
editorLineWidth: EditorLineWidth
|
||||||
children: NonNullable<ReactNode>
|
children: NonNullable<ReactNode>
|
||||||
},
|
},
|
||||||
@@ -22,7 +24,7 @@ export const EditorContentWithSafeAreaPadding = forwardRef(function EditorConten
|
|||||||
className={classNames(
|
className={classNames(
|
||||||
ElementIds.EditorContent,
|
ElementIds.EditorContent,
|
||||||
'z-editor-content overflow-auto sm:[&>*]:mx-[var(--editor-margin)] sm:[&>*]:max-w-[var(--editor-max-width)]',
|
'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={
|
style={
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -955,7 +955,11 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
|
|||||||
</div>
|
</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 && (
|
{editorMode === 'component' && this.state.editorComponentViewer && (
|
||||||
<div className="component-view relative flex-grow">
|
<div className="component-view relative flex-grow">
|
||||||
{this.state.paneGestureEnabled && <div className="absolute left-0 top-0 h-full w-[20px] md:hidden" />}
|
{this.state.paneGestureEnabled && <div className="absolute left-0 top-0 h-full w-[20px] md:hidden" />}
|
||||||
|
|||||||
Reference in New Issue
Block a user