From d77ca18b0bd885777d8c55b690ecc2428484d746 Mon Sep 17 00:00:00 2001 From: Antoine Clausse Date: Wed, 23 Oct 2024 09:32:25 +0200 Subject: [PATCH] [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 --- .../history/components/history-content.tsx | 33 ------------------- .../history/components/history-root.tsx | 32 ------------------ 2 files changed, 65 deletions(-) delete mode 100644 services/web/frontend/js/features/history/components/history-content.tsx delete mode 100644 services/web/frontend/js/features/history/components/history-root.tsx diff --git a/services/web/frontend/js/features/history/components/history-content.tsx b/services/web/frontend/js/features/history/components/history-content.tsx deleted file mode 100644 index 4e6b0a9fd1..0000000000 --- a/services/web/frontend/js/features/history/components/history-content.tsx +++ /dev/null @@ -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 = - } else { - content = ( - <> - - - - ) - } - - return ( - <> - {fileTreeContainer - ? createPortal(, fileTreeContainer) - : null} -
{content}
- - ) -} diff --git a/services/web/frontend/js/features/history/components/history-root.tsx b/services/web/frontend/js/features/history/components/history-root.tsx deleted file mode 100644 index 0329eda286..0000000000 --- a/services/web/frontend/js/features/history/components/history-root.tsx +++ /dev/null @@ -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 ( - }> - - - ) -} - -function HistoryRoot() { - return ( - -
- - ) -} - -export default withErrorBoundary(HistoryRoot, ErrorBoundaryFallback)