From 3f0343e7fc3a112fa71c98c69e4d30ea8dd22019 Mon Sep 17 00:00:00 2001 From: uniks Date: Tue, 15 Oct 2024 15:42:57 +0500 Subject: [PATCH] 3 task --- src/components/App.tsx | 31 +++++++++++++++++++++++-- src/components/Logo.tsx | 17 ++++++++++++++ src/components/NotFound.tsx | 12 ++++++++++ src/components/pages/Favorites.tsx | 15 +++++------- src/components/pages/FavoritesEmpty.tsx | 12 +++------- src/components/pages/Login.tsx | 16 ++++++------- src/components/pages/MainEmpty.tsx | 12 +++------- src/components/pages/MainScreen.tsx | 19 +++++++-------- src/components/pages/Offer.tsx | 15 +++++------- src/components/pages/OfferNotLogged.tsx | 11 ++------- src/components/private-route.tsx | 20 ++++++++++++++++ src/const.ts | 14 +++++++++++ 12 files changed, 128 insertions(+), 66 deletions(-) create mode 100644 src/components/Logo.tsx create mode 100644 src/components/NotFound.tsx create mode 100644 src/components/private-route.tsx create mode 100644 src/const.ts diff --git a/src/components/App.tsx b/src/components/App.tsx index bb1f2c0..40b4a5c 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1,11 +1,38 @@ -import {MainScreen} from './pages/MainScreen'; +import { BrowserRouter, Route, Routes } from 'react-router-dom'; +import { HelmetProvider } from 'react-helmet-async'; +import MainScreen from './pages/MainScreen'; +import Login from './pages/Login'; +import Favorites from './pages/Favorites'; +import Offer from './pages/Offer'; +import NotFound from './NotFound'; +import AppRoute, { AuthorizationStatus } from '../const'; +import PrivateRoute from './private-route'; type AppScreenProps = { placesCount: number; } function App({placesCount}: AppScreenProps){ return ( - + + + + } /> + }/> + + + + } + /> + }/> + }/> + + + ); } export default App; diff --git a/src/components/Logo.tsx b/src/components/Logo.tsx new file mode 100644 index 0000000..527daa1 --- /dev/null +++ b/src/components/Logo.tsx @@ -0,0 +1,17 @@ +import { Link } from 'react-router-dom'; + +function Logo(){ + return( + + 6 cities logo + + ); +} + +export default Logo; diff --git a/src/components/NotFound.tsx b/src/components/NotFound.tsx new file mode 100644 index 0000000..493c6c1 --- /dev/null +++ b/src/components/NotFound.tsx @@ -0,0 +1,12 @@ +import { Link } from 'react-router-dom'; + +function NotFound() { + return ( +
+

404 Not Found

+ Go to Home Page +
+ ); +} + +export default NotFound; diff --git a/src/components/pages/Favorites.tsx b/src/components/pages/Favorites.tsx index 3b51022..dc32816 100644 --- a/src/components/pages/Favorites.tsx +++ b/src/components/pages/Favorites.tsx @@ -1,19 +1,16 @@ +import Logo from '../Logo'; +import { Helmet } from 'react-helmet-async'; function Favorites(){ return (
+ + Избранное +
- - 6 cities logo - +