11import React , { useEffect } from "react" ;
22import { Remirror , ThemeProvider , useRemirror } from "@remirror/react" ;
33import { AllStyledComponent } from "@remirror/styles/emotion" ;
4- import { Affix , Col , Row } from "antd" ;
54import { useAtom } from "jotai" ;
6-
5+ import { Grid , Box } from "@mui/material" ;
76import { debateAtom } from "../../atoms/debate" ;
87import colors from "../../styles/colors" ;
98import 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