mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-09 00:59:02 +02: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:
@@ -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)
|
||||
Reference in New Issue
Block a user