mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
c8a6b48c0b
History diff view and changes list for React IDE page GitOrigin-RevId: 1a4fb7abbb00537f45a3dc779120327cf9edc781
28 lines
937 B
TypeScript
28 lines
937 B
TypeScript
import { createPortal } from 'react-dom'
|
|
import HistoryFileTree from '@/features/history/components/history-file-tree'
|
|
import LoadingSpinner from '@/shared/components/loading-spinner'
|
|
import DiffView from '@/features/history/components/diff-view/diff-view'
|
|
import ChangeList from '@/features/history/components/change-list/change-list'
|
|
import { useHistoryContext } from '@/features/history/context/history-context'
|
|
|
|
export default function History() {
|
|
const { updatesInfo } = useHistoryContext()
|
|
const fileTreeContainer = document.querySelector('.history-file-tree')
|
|
|
|
return (
|
|
<>
|
|
{fileTreeContainer &&
|
|
createPortal(<HistoryFileTree />, fileTreeContainer)}
|
|
<div className="history-react">
|
|
{updatesInfo.loadingState === 'loadingInitial' ? (
|
|
<LoadingSpinner />
|
|
) : (
|
|
<>
|
|
<DiffView />
|
|
<ChangeList />
|
|
</>
|
|
)}
|
|
</div>
|
|
</>
|
|
)
|
|
}
|