File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1- import { Outlet } from 'react-router-dom' ;
1+ import { Outlet , useLocation } from 'react-router-dom' ;
22import Gutter from './Gutter' ;
33import Sidebar from './Sidebar/Sidebar' ;
44import type { DataSource } from '../types/datasource' ;
@@ -9,10 +9,13 @@ interface LayoutProps {
99}
1010
1111export default function Layout ( { sources, isLoading } : LayoutProps ) {
12+ const location = useLocation ( ) ;
13+ const showSidebar = location . pathname . startsWith ( '/source/' ) ;
14+
1215 return (
1316 < div className = "flex h-screen bg-background" >
1417 < Gutter sources = { sources } />
15- < Sidebar sources = { sources } isLoading = { isLoading } />
18+ { showSidebar && < Sidebar sources = { sources } isLoading = { isLoading } /> }
1619 < main className = "flex-1 overflow-auto" aria-label = "Main content" >
1720 < Outlet />
1821 </ main >
You can’t perform that action at this time.
0 commit comments