mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
[web] Remove dead code: history-content & history-root (#20959)
They are duplicated by: * services/web/frontend/js/features/ide-react/components/history.tsx * services/web/frontend/js/features/ide-react/components/history-root.tsx GitOrigin-RevId: c3f13ea9016530182ae623b06e91a9fdb2be7a87
This commit is contained in:
parent
388f16169e
commit
d77ca18b0b
2 changed files with 0 additions and 65 deletions
|
@ -1,33 +0,0 @@
|
|||
import { useHistoryContext } from '@/features/history/context/history-context'
|
||||
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 { createPortal } from 'react-dom'
|
||||
import HistoryFileTree from '@/features/history/components/history-file-tree'
|
||||
|
||||
const fileTreeContainer = document.getElementById('history-file-tree')
|
||||
|
||||
export default function HistoryContent() {
|
||||
const { updatesInfo } = useHistoryContext()
|
||||
|
||||
let content
|
||||
if (updatesInfo.loadingState === 'loadingInitial') {
|
||||
content = <LoadingSpinner />
|
||||
} else {
|
||||
content = (
|
||||
<>
|
||||
<DiffView />
|
||||
<ChangeList />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{fileTreeContainer
|
||||
? createPortal(<HistoryFileTree />, fileTreeContainer)
|
||||
: null}
|
||||
<div className="history-react">{content}</div>
|
||||
</>
|
||||
)
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
import { HistoryProvider } from '../context/history-context'
|
||||
import { useLayoutContext } from '../../../shared/context/layout-context'
|
||||
import { FullSizeLoadingSpinner } from '../../../shared/components/loading-spinner'
|
||||
import { ErrorBoundaryFallback } from '../../../shared/components/error-boundary-fallback'
|
||||
import withErrorBoundary from '../../../infrastructure/error-boundary'
|
||||
import { lazy, Suspense } from 'react'
|
||||
|
||||
const HistoryContent = lazy(() => import('./history-content'))
|
||||
|
||||
function Main() {
|
||||
const { view } = useLayoutContext()
|
||||
|
||||
if (view !== 'history') {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<Suspense fallback={<FullSizeLoadingSpinner delay={500} />}>
|
||||
<HistoryContent />
|
||||
</Suspense>
|
||||
)
|
||||
}
|
||||
|
||||
function HistoryRoot() {
|
||||
return (
|
||||
<HistoryProvider>
|
||||
<Main />
|
||||
</HistoryProvider>
|
||||
)
|
||||
}
|
||||
|
||||
export default withErrorBoundary(HistoryRoot, ErrorBoundaryFallback)
|
Loading…
Reference in a new issue