diff --git a/src/components/ConnectionRequired.tsx b/src/components/ConnectionRequired.tsx index 7ec089af50..4a2241fcf7 100644 --- a/src/components/ConnectionRequired.tsx +++ b/src/components/ConnectionRequired.tsx @@ -1,5 +1,5 @@ import React, { FunctionComponent, useEffect, useState } from 'react'; -import { useNavigate } from 'react-router-dom'; +import { Outlet, useNavigate } from 'react-router-dom'; import alert from './alert'; import { appRouter } from './appRouter'; @@ -33,7 +33,6 @@ type ConnectionRequiredProps = { * If a condition fails, this component will navigate to the appropriate page. */ const ConnectionRequired: FunctionComponent = ({ - children, isAdminRequired = false, isUserRequired = true }) => { @@ -161,9 +160,7 @@ const ConnectionRequired: FunctionComponent = ({ return null; } - return ( - <>{children} - ); + return ; }; export default ConnectionRequired; diff --git a/src/routes/index.tsx b/src/routes/index.tsx index c1a3556d45..abddc81170 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -14,70 +14,22 @@ import UserProfilesPage from './UserProfilesPage'; const AppRoutes = () => ( - - - - } - /> - - - - } - /> - - - - } - /> - - - - } - /> - - - - } - /> - - - - } - /> - - - - } - /> - - - - } - /> + {/* User routes */} + }> + } /> + } /> + + + {/* Admin routes */} + }> + } /> + } /> + } /> + } /> + } /> + } /> + + {/* Suppress warnings for unhandled routes */}