Skip to content

Commit aa865b3

Browse files
authored
Merge pull request #1679 from AletheiaFact/1559-migration-editor
Migrate Grid and Box Components MUI from Editor
2 parents a1b40ea + fa851ca commit aa865b3

File tree

1 file changed

+26
-29
lines changed

1 file changed

+26
-29
lines changed

src/components/Editor/Editor.tsx

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import React, { useEffect } from "react";
22
import { Remirror, ThemeProvider, useRemirror } from "@remirror/react";
33
import { AllStyledComponent } from "@remirror/styles/emotion";
4-
import { Affix, Col, Row } from "antd";
54
import { useAtom } from "jotai";
6-
5+
import { Grid, Box } from "@mui/material";
76
import { debateAtom } from "../../atoms/debate";
87
import colors from "../../styles/colors";
98
import AddPersonalityEditorButton from "./AddPersonalityEditorButton";
@@ -73,14 +72,15 @@ const Editor = ({ claim, sitekey }: IEditorProps) => {
7372
};
7473

7574
return (
76-
<Row
75+
<Grid
76+
container
7777
style={{
7878
width: "100%",
7979
paddingTop: "32px",
8080
justifyContent: "center",
8181
}}
8282
>
83-
<Col span={21} style={{ display: "flex", justifyContent: "end" }}>
83+
<Grid item sm={11} style={{ display: "flex", justifyContent: "end" }}>
8484
<Button
8585
onMouseDown={(event) => event.preventDefault()}
8686
onClick={handleClickUpdateStatus}
@@ -94,7 +94,7 @@ const Editor = ({ claim, sitekey }: IEditorProps) => {
9494
}`
9595
)}
9696
</Button>
97-
</Col>
97+
</Grid>
9898
<AllStyledComponent
9999
style={{
100100
padding: "10px",
@@ -110,29 +110,26 @@ const Editor = ({ claim, sitekey }: IEditorProps) => {
110110
<EditorAutoSaveTimerProvider
111111
reference={claim.editor.reference}
112112
>
113-
<Affix>
114-
<div
115-
style={{
116-
display: "flex",
117-
justifyContent: "space-evenly",
118-
backgroundColor: colors.neutral,
119-
padding: "10px",
120-
}}
121-
>
122-
{personalities.map((personality) => {
123-
return (
124-
<AddPersonalityEditorButton
125-
key={personality._id}
126-
personalityId={personality._id}
127-
personalityName={
128-
personality.name
129-
}
130-
disabled={!isLive}
131-
/>
132-
);
133-
})}
134-
</div>
135-
</Affix>
113+
<Box
114+
sx={{
115+
position: "sticky",
116+
top: 0,
117+
zIndex: 10,
118+
display: "flex",
119+
justifyContent: "space-evenly",
120+
backgroundColor: colors.neutral,
121+
padding: "10px",
122+
}}
123+
>
124+
{personalities.map((personality) => (
125+
<AddPersonalityEditorButton
126+
key={personality._id}
127+
personalityId={personality._id}
128+
personalityName={personality.name}
129+
disabled={!isLive}
130+
/>
131+
))}
132+
</Box>
136133
<EditorContent
137134
reference={claim.editor.reference}
138135
isLive={isLive}
@@ -141,7 +138,7 @@ const Editor = ({ claim, sitekey }: IEditorProps) => {
141138
</Remirror>
142139
</ThemeProvider>
143140
</AllStyledComponent>
144-
</Row>
141+
</Grid>
145142
);
146143
};
147144

0 commit comments

Comments
 (0)