From 91429b67cb97d3b2cab704f9fdcef72a618e5ff8 Mon Sep 17 00:00:00 2001 From: Brendan Allan Date: Fri, 17 Nov 2023 12:48:43 +0800 Subject: [PATCH] remove overview from sidebar and default to /network --- .../Layout/Sidebar/EphemeralSection.tsx | 2 +- interface/app/$libraryId/Layout/index.tsx | 6 +++--- interface/app/$libraryId/index.tsx | 2 +- interface/app/$libraryId/network.tsx | 17 ++--------------- interface/app/index.tsx | 2 +- 5 files changed, 8 insertions(+), 21 deletions(-) diff --git a/interface/app/$libraryId/Layout/Sidebar/EphemeralSection.tsx b/interface/app/$libraryId/Layout/Sidebar/EphemeralSection.tsx index e2d1e717a0f6..c65816bab94a 100644 --- a/interface/app/$libraryId/Layout/Sidebar/EphemeralSection.tsx +++ b/interface/app/$libraryId/Layout/Sidebar/EphemeralSection.tsx @@ -95,7 +95,7 @@ export const EphemeralSection = () => { return ( diff --git a/interface/app/$libraryId/Layout/index.tsx b/interface/app/$libraryId/Layout/index.tsx index 2be444b4f106..ad08b2d8222f 100644 --- a/interface/app/$libraryId/Layout/index.tsx +++ b/interface/app/$libraryId/Layout/index.tsx @@ -1,6 +1,6 @@ import clsx from 'clsx'; import { Suspense, useEffect, useMemo, useRef } from 'react'; -import { Navigate, Outlet, useNavigate } from 'react-router-dom'; +import { Navigate, Outlet, useLocation, useNavigate } from 'react-router-dom'; import { ClientContextProvider, initPlausible, @@ -47,8 +47,8 @@ const Layout = () => { if (library === null && libraries.data) { const firstLibrary = libraries.data[0]; - if (firstLibrary) return ; - else return ; + if (firstLibrary) return ; + else return ; } return ( diff --git a/interface/app/$libraryId/index.tsx b/interface/app/$libraryId/index.tsx index df84fbb41ede..a04323cc9bc6 100644 --- a/interface/app/$libraryId/index.tsx +++ b/interface/app/$libraryId/index.tsx @@ -21,7 +21,7 @@ const explorerRoutes: RouteObject[] = [ { path: 'location/:id', lazy: () => import('./location/$id') }, { path: 'node/:id', lazy: () => import('./node/$id') }, { path: 'tag/:id', lazy: () => import('./tag/$id') }, - { path: 'network/:id', lazy: () => import('./network') } + { path: 'network', lazy: () => import('./network') } // { path: 'search/:id', lazy: () => import('./search') } ]; diff --git a/interface/app/$libraryId/network.tsx b/interface/app/$libraryId/network.tsx index e3c57b3b590e..4c7c48e608dd 100644 --- a/interface/app/$libraryId/network.tsx +++ b/interface/app/$libraryId/network.tsx @@ -1,8 +1,6 @@ -import { memo, Suspense, useDeferredValue, useMemo } from 'react'; +import { useMemo } from 'react'; import { useDiscoveredPeers } from '@sd/client'; -import { PathParamsSchema, type PathParams } from '~/app/route-schemas'; import { Icon } from '~/components'; -import { useZodSearchParams } from '~/hooks'; import { useRouteTitle } from '~/hooks/useRouteTitle'; import Explorer from './Explorer'; @@ -12,7 +10,7 @@ import { DefaultTopBarOptions } from './Explorer/TopBarOptions'; import { useExplorer, useExplorerSettings } from './Explorer/useExplorer'; import { TopBarPortal } from './TopBar/Portal'; -const Network = memo((props: { args: PathParams }) => { +export const Component = () => { const title = useRouteTitle('Network'); const discoveredPeers = useDiscoveredPeers(); @@ -71,15 +69,4 @@ const Network = memo((props: { args: PathParams }) => { /> ); -}); - -export const Component = () => { - const [pathParams] = useZodSearchParams(PathParamsSchema); - const path = useDeferredValue(pathParams); - - return ( - - - - ); }; diff --git a/interface/app/index.tsx b/interface/app/index.tsx index 5953cb04a534..8ac8b777a45e 100644 --- a/interface/app/index.tsx +++ b/interface/app/index.tsx @@ -21,7 +21,7 @@ const Index = () => { const libraryId = currentLibrary ? currentLibrary.uuid : libraries.data[0]?.uuid; - return ; + return ; }; const Wrapper = () => {