fix(component): content should subtract height of the header (#4507)

This commit is contained in:
Joooye_34
2023-09-28 15:04:12 +08:00
committed by GitHub
parent 603f82ffc2
commit b012e615ba
2 changed files with 12 additions and 2 deletions
@@ -15,7 +15,7 @@ export const pluginContainer = style({
}); });
export const editor = style({ export const editor = style({
height: 'calc(100% - 52px)', height: '100%',
selectors: { selectors: {
'&.full-screen': { '&.full-screen': {
vars: { vars: {
@@ -25,6 +25,11 @@ export const editor = style({
}, },
}, },
}); });
globalStyle(`${editor} .affine-doc-viewport`, {
paddingBottom: '150px',
});
globalStyle('.is-public-page affine-page-meta-data', { globalStyle('.is-public-page affine-page-meta-data', {
display: 'none', display: 'none',
}); });
@@ -211,6 +211,7 @@ const LayoutPanel = memo(function LayoutPanel(
return ( return (
<PanelGroup <PanelGroup
direction={node.direction} direction={node.direction}
style={depth === 0 ? { height: 'calc(100% - 52px)' } : undefined}
className={depth === 0 ? editorContainer : undefined} className={depth === 0 ? editorContainer : undefined}
> >
<Panel <Panel
@@ -260,7 +261,11 @@ export const PageDetailEditor = (props: PageDetailEditorProps) => {
if (layout === 'editor') { if (layout === 'editor') {
return ( return (
<Suspense> <Suspense>
<PanelGroup direction="horizontal" className={editorContainer}> <PanelGroup
style={{ height: 'calc(100% - 52px)' }}
direction="horizontal"
className={editorContainer}
>
<Panel> <Panel>
<EditorWrapper {...props} /> <EditorWrapper {...props} />
</Panel> </Panel>