fix(editor): remove rootRect and modify layout

This commit is contained in:
austaras
2022-07-26 17:28:19 +08:00
parent 8b5e47ed73
commit b9f46028a8
21 changed files with 138 additions and 200 deletions

View File

@@ -55,7 +55,7 @@ export function Page(props: PageProps) {
);
await services.api.editorBlock.clearUndoRedo(props.workspace);
};
update_recent_pages();
updateRecentPages();
}, [user, props.workspace, page_id]);
return (
@@ -89,7 +89,7 @@ export function Page(props: PageProps) {
title="Activities"
initialOpen={false}
>
<Activities></Activities>
<Activities />
</CollapsibleTitle>
</div>
<div>
@@ -102,25 +102,23 @@ export function Page(props: PageProps) {
</WorkspaceSidebar>
</LigoLeftContainer>
<LigoRightContainer>
<LigoEditorOuterContainer>
{page_id ? (
<AffineEditor
workspace={props.workspace}
rootBlockId={page_id}
/>
) : (
<Box
sx={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
width: '100%',
}}
>
<CircularProgress />
</Box>
)}
</LigoEditorOuterContainer>
{page_id ? (
<AffineEditor
workspace={props.workspace}
rootBlockId={page_id}
/>
) : (
<Box
sx={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
width: '100%',
}}
>
<CircularProgress />
</Box>
)}
</LigoRightContainer>
</LigoApp>
);
@@ -128,7 +126,6 @@ export function Page(props: PageProps) {
const LigoApp = styled('div')({
width: '100vw',
position: 'relative',
display: 'flex',
flex: '1 1 0%',
backgroundColor: 'white',
@@ -136,19 +133,11 @@ const LigoApp = styled('div')({
});
const LigoRightContainer = styled('div')({
position: 'relative',
width: '100%',
overflowY: 'auto',
flex: 'auto',
});
const LigoEditorOuterContainer = styled('div')({
position: 'absolute',
height: '100%',
width: '100%',
overflowX: 'hidden',
overflowY: 'hidden',
});
const LigoLeftContainer = styled('div')({
flex: '0 0 auto',
});