diff --git a/rsconcept/frontend/src/App.tsx b/rsconcept/frontend/src/App.tsx index ffa2af93..c9a5e206 100644 --- a/rsconcept/frontend/src/App.tsx +++ b/rsconcept/frontend/src/App.tsx @@ -1,4 +1,4 @@ -import { Route, Routes } from 'react-router-dom'; +import { createBrowserRouter, Outlet, RouterProvider } from 'react-router-dom'; import Footer from './components/Footer'; import Navigation from './components/Navigation/Navigation'; @@ -15,8 +15,8 @@ import RestorePasswordPage from './pages/RestorePasswordPage'; import RSFormPage from './pages/RSFormPage'; import UserProfilePage from './pages/UserProfilePage'; -function App () { - const { noNavigation, noFooter, viewportHeight, mainHeight } = useConceptTheme(); +function Root() { + const { noNavigation, noFooter, viewportHeight, mainHeight } = useConceptTheme(); return (
@@ -26,24 +26,9 @@ function App () { draggable={false} pauseOnFocusLoss={false} /> -
- - } /> - - } /> - } /> - } /> - } /> - - } /> - - } /> - } /> - } /> - } /> - +
{!noNavigation && !noFooter &&
}
@@ -51,4 +36,57 @@ function App () { ); } +const router = createBrowserRouter([ + { + path: '/', + element: , + errorElement: , + children: [ + { + path: '', + element: , + }, + { + path: 'login', + element: , + }, + { + path: 'signup', + element: , + }, + { + path: 'restore-password', + element: , + }, + { + path: 'profile', + element: , + }, + { + path: 'manuals', + element: , + }, + + { + path: 'library', + element: , + }, + { + path: 'rsforms/:id', + element: , + }, + { + path: 'rsform-create', + element: , + }, + ] + }, +]); + +function App () { + return ( + + ); +} + export default App; diff --git a/rsconcept/frontend/src/components/BackendError.tsx b/rsconcept/frontend/src/components/BackendError.tsx index 771f66a0..02e7d911 100644 --- a/rsconcept/frontend/src/components/BackendError.tsx +++ b/rsconcept/frontend/src/components/BackendError.tsx @@ -9,7 +9,7 @@ interface BackendErrorProps { } function DescribeError(error: ErrorInfo) { - console.log(error); + reportError(error); if (!error) { return

Ошибки отсутствуют

; } else if (typeof error === 'string') { diff --git a/rsconcept/frontend/src/components/Common/EmbedYoutube.tsx b/rsconcept/frontend/src/components/Common/EmbedYoutube.tsx new file mode 100644 index 00000000..37264450 --- /dev/null +++ b/rsconcept/frontend/src/components/Common/EmbedYoutube.tsx @@ -0,0 +1,30 @@ +interface EmbedYoutubeProps { + videoID: string + pxHeight: number + pxWidth?: number +} + +function EmbedYoutube({ videoID, pxHeight, pxWidth }: EmbedYoutubeProps) { + if (!pxWidth) { + pxWidth = pxHeight * 16 / 9; + } + return ( +
+