diff --git a/apps/react/src/app/App.tsx b/apps/react/src/app/App.tsx index 925de583d..bd0f9caa2 100644 --- a/apps/react/src/app/App.tsx +++ b/apps/react/src/app/App.tsx @@ -1,8 +1,13 @@ -export default function App() { +import React, { Suspense } from 'react' +import { RouterProvider } from 'react-router-dom' +import { router } from './router/router' + +const App: React.FC = () => { return ( -
-

Aeroflot Flights - React Migration

-

Coming soon...

-
+ Loading...}> + + ) } + +export default App diff --git a/apps/react/src/app/pages/BoardPage.tsx b/apps/react/src/app/pages/BoardPage.tsx new file mode 100644 index 000000000..2fb71d253 --- /dev/null +++ b/apps/react/src/app/pages/BoardPage.tsx @@ -0,0 +1,10 @@ +import React from 'react' + +export const BoardPage: React.FC = () => { + return ( +
+

Online Board

+

Arrivals and Departures

+
+ ) +} diff --git a/apps/react/src/app/pages/FlightsMapPage.tsx b/apps/react/src/app/pages/FlightsMapPage.tsx new file mode 100644 index 000000000..88ffaee7e --- /dev/null +++ b/apps/react/src/app/pages/FlightsMapPage.tsx @@ -0,0 +1,10 @@ +import React from 'react' + +export const FlightsMapPage: React.FC = () => { + return ( +
+

Flights Map

+

Real-time Flight Map

+
+ ) +} diff --git a/apps/react/src/app/pages/NotFound.tsx b/apps/react/src/app/pages/NotFound.tsx new file mode 100644 index 000000000..a194705b1 --- /dev/null +++ b/apps/react/src/app/pages/NotFound.tsx @@ -0,0 +1,11 @@ +import React from 'react' + +export const NotFound: React.FC = () => { + return ( +
+

404 - Page Not Found

+

The page you are looking for does not exist.

+ Back to Home +
+ ) +} diff --git a/apps/react/src/app/pages/SchedulePage.tsx b/apps/react/src/app/pages/SchedulePage.tsx new file mode 100644 index 000000000..6257fe88a --- /dev/null +++ b/apps/react/src/app/pages/SchedulePage.tsx @@ -0,0 +1,10 @@ +import React from 'react' + +export const SchedulePage: React.FC = () => { + return ( +
+

Schedule

+

Flight Schedule

+
+ ) +} diff --git a/apps/react/src/app/pages/StartPage.tsx b/apps/react/src/app/pages/StartPage.tsx new file mode 100644 index 000000000..3cde410ed --- /dev/null +++ b/apps/react/src/app/pages/StartPage.tsx @@ -0,0 +1,10 @@ +import React from 'react' + +export const StartPage: React.FC = () => { + return ( +
+

Aeroflot Flights - Home

+

Welcome to Aeroflot Flights

+
+ ) +} diff --git a/apps/react/src/app/router/router.tsx b/apps/react/src/app/router/router.tsx new file mode 100644 index 000000000..f18e69a39 --- /dev/null +++ b/apps/react/src/app/router/router.tsx @@ -0,0 +1,4 @@ +import { createBrowserRouter } from 'react-router-dom' +import routes from './routes' + +export const router = createBrowserRouter(routes) diff --git a/apps/react/src/app/router/routes.tsx b/apps/react/src/app/router/routes.tsx new file mode 100644 index 000000000..7b8af92fb --- /dev/null +++ b/apps/react/src/app/router/routes.tsx @@ -0,0 +1,39 @@ +import { RouteObject } from 'react-router-dom' +import { NotFound } from '../pages/NotFound' + +const routes: RouteObject[] = [ + { + path: '/', + lazy: async () => { + const { StartPage } = await import('../pages/StartPage') + return { Component: StartPage } + }, + }, + { + path: '/board', + lazy: async () => { + const { BoardPage } = await import('../pages/BoardPage') + return { Component: BoardPage } + }, + }, + { + path: '/schedule', + lazy: async () => { + const { SchedulePage } = await import('../pages/SchedulePage') + return { Component: SchedulePage } + }, + }, + { + path: '/flights-map', + lazy: async () => { + const { FlightsMapPage } = await import('../pages/FlightsMapPage') + return { Component: FlightsMapPage } + }, + }, + { + path: '*', + element: , + }, +] + +export default routes