diff --git a/frontend/src/components/App.tsx b/frontend/src/components/App.tsx index 108be9191..413d397be 100644 --- a/frontend/src/components/App.tsx +++ b/frontend/src/components/App.tsx @@ -1,5 +1,5 @@ import React, { Suspense, useContext } from 'react'; -import { Routes, Route, Navigate, useLocation } from 'react-router-dom'; +import { Routes, Route, Navigate, useMatch } from 'react-router-dom'; import { accessErrorPage, clusterPath, @@ -50,17 +50,16 @@ const queryClient = new QueryClient({ }); const App: React.FC = () => { const { isDarkMode } = useContext(ThemeModeContext); - const location = useLocation(); - const isAuthPage = location.pathname === '/auth'; + const isAuthRoute = useMatch('/auth/*'); return ( - - - }> - {isAuthPage ? ( - - ) : ( + + {isAuthRoute ? ( + + ) : ( + + }> @@ -100,10 +99,10 @@ const App: React.FC = () => { - )} - - - + + + )} + ); diff --git a/frontend/src/components/AuthPage/AuthPage.tsx b/frontend/src/components/AuthPage/AuthPage.tsx index 9d40e6274..9adf7f783 100644 --- a/frontend/src/components/AuthPage/AuthPage.tsx +++ b/frontend/src/components/AuthPage/AuthPage.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import { useAuthSettings } from 'lib/hooks/api/appConfig'; import Footer from './Footer/Footer'; import Header from './Header/Header'; @@ -6,10 +7,12 @@ import SignIn from './SignIn/SignIn'; import * as S from './AuthPage.styled'; function AuthPage() { + const { data } = useAuthSettings(); + return (
- + {data && }