Skip to content

Commit fef570b

Browse files
josh-ramos-22Josh Ramos
andauthored
moved sync and publish buttons to header of editor (#336)
Co-authored-by: Josh Ramos <josh.ramos@student.unsw.edu.au>
1 parent 19c41b9 commit fef570b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

frontend/src/deprecated/components/Editor/EditorHeader.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import styled from 'styled-components';
33
import Button from '@mui/material/Button';
44

55
const Container = styled.div`
6-
height: 50px;
6+
height: 65px;
77
background: #A09FE3;
88
width: 100%;
99
`
@@ -16,7 +16,7 @@ const HeaderFlex = styled.div`
1616
display: flex;
1717
flex-direction: row;
1818
flex-wrap: nowrap;
19-
justify-content: space-between;
19+
justify-content: flex-end;
2020
align-items: center;
2121
padding: 0.3rem 0.5rem;
2222
`
@@ -39,10 +39,11 @@ const ButtonStyle = styled(Button)`
3939
`
4040
/* Preview and text to be changed into a dropdown menu */
4141

42-
const EditorHeader: React.FC = () => {
42+
const EditorHeader: React.FC = (props) => {
4343
return (
4444
<Container>
4545
<HeaderFlex>
46+
{props.children}
4647
{/* <ButtonGroup>
4748
<ButtonStyle>
4849

frontend/src/packages/editor/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,15 @@ const EditorPage: FC = () => {
8282

8383
return (
8484
<div style={{ height: "100%" }}>
85-
<EditorHeader />
85+
<EditorHeader>
86+
<SyncDocument onClick={() => syncDocument()} />
87+
<PublishDocument onClick={() => publishDocument(id ?? "")} />
88+
</EditorHeader>
8689
<Container>
8790
{blocks.map((block, idx) => createBlock(block, idx, focusedId === idx))}
8891
<InsertContentWrapper>
8992
<CreateHeadingBlock onClick={buildButtonClickHandler("heading")} />
9093
<CreateContentBlock onClick={buildButtonClickHandler("paragraph")} />
91-
<SyncDocument onClick={() => syncDocument()} />
92-
<PublishDocument onClick={() => publishDocument(id ?? "")} />
9394
</InsertContentWrapper>
9495
</Container>
9596
</div>

0 commit comments

Comments
 (0)