Merge pull request #12339 from overleaf/ii-react-history-editor-and-change-list-init

[web] History editor and change list initialisation

GitOrigin-RevId: bb7800301d28c296bd524212cd27ddcd8defd149
This commit is contained in:
ilkin-overleaf 2023-03-23 10:35:20 +02:00 committed by Copybot
parent e934e9af3d
commit d1d47b2767
9 changed files with 77 additions and 3 deletions

View file

@ -0,0 +1,13 @@
import ToggleSwitch from './toggle-switch'
import Main from './main'
function ChangeList() {
return (
<aside className="change-list">
<ToggleSwitch />
<Main />
</aside>
)
}
export default ChangeList

View file

@ -0,0 +1,5 @@
function Main() {
return <div>Change List</div>
}
export default Main

View file

@ -0,0 +1,5 @@
function ToggleSwitch() {
return <div>Toggle Switch</div>
}
export default ToggleSwitch

View file

@ -0,0 +1,13 @@
import Toolbar from './toolbar'
import Main from './main'
function Editor() {
return (
<div className="point-in-time-panel">
<Toolbar />
<Main />
</div>
)
}
export default Editor

View file

@ -0,0 +1,5 @@
function Main() {
return <div>Main (editor)</div>
}
export default Main

View file

@ -0,0 +1,5 @@
function Toolbar() {
return <div>Toolbar</div>
}
export default Toolbar

View file

@ -1,15 +1,20 @@
import { createPortal } from 'react-dom'
import HistoryFileTree from './history-file-tree'
import ChangeList from './change-list/change-list'
import Editor from './editor/editor'
const fileTreeContainer = document.getElementById('history-file-tree')
export default function HistoryRoot() {
const fileTreeContainer = document.getElementById('history-file-tree')
return (
<>
{fileTreeContainer
? createPortal(<HistoryFileTree />, fileTreeContainer)
: null}
History
<div className="history-react">
<ChangeList />
<Editor />
</div>
</>
)
}

View file

@ -1,5 +1,6 @@
@import './editor/file-tree.less';
@import './editor/history.less';
@import './editor/history-react.less';
@import './editor/toolbar.less';
@import './editor/left-menu.less';
@import './editor/pdf.less';

View file

@ -0,0 +1,22 @@
@changesListWidth: 320px;
.history-react {
.point-in-time-panel {
.full-size;
margin-right: @changesListWidth;
}
.change-list {
border-left: 1px solid @editor-border-color;
height: 100%;
width: @changesListWidth;
position: absolute;
right: 0;
}
.editor-dark {
.change-list {
border-color: @editor-dark-toolbar-border-color;
}
}
}