diff --git a/lab4/src/App.jsx b/lab4/src/App.jsx
index 7c7b6c4..63089b5 100644
--- a/lab4/src/App.jsx
+++ b/lab4/src/App.jsx
@@ -1,19 +1,24 @@
-import { Container } from 'react-bootstrap'
-import './App.css'
-import Navigation from './components/navigation/Navigation'
-import { Outlet } from 'react-router-dom'
-import Footer from './components/footer/Footer'
+import PropTypes from 'prop-types';
+import { Container } from 'react-bootstrap';
+import { Outlet } from 'react-router-dom';
+import './App.css';
+import Footer from './components/footer/Footer.jsx';
+import Navigation from './components/navigation/Navigation.jsx';
-function App() {
+const App = ({ routes }) => {
return (
<>
-
+
>
- )
-}
+ );
+};
-export default App
+App.propTypes = {
+ routes: PropTypes.array,
+};
+
+export default App;
diff --git a/lab4/src/components/navigation/Navigation.css b/lab4/src/components/navigation/Navigation.css
index 127039a..4c156b0 100644
--- a/lab4/src/components/navigation/Navigation.css
+++ b/lab4/src/components/navigation/Navigation.css
@@ -1,37 +1,37 @@
-header .navbar {
+.my-navbar {
background-color: #D9D9D9;
}
@media (min-width: 768px) {
- header .navbar {
+ .my-navbar {
height: 100px;
}
}
-header .nav-link:hover {
+.my-navbar {
text-decoration: underline;
}
@media (max-width: 576px) {
- header .navbar-brand img {
+ .my-navbar img {
margin-left: 25px;
}
}
@media (min-width: 577px) and (max-width: 992px) {
- header .navbar-brand img {
+ .my-navbar img {
margin-left: 25px;
}
}
@media (min-width: 993px) and (max-width: 1200px) {
- header .navbar-brand img {
+ .my-navbar img {
margin-left: 150px;
}
}
@media (min-width: 1201px) {
- header .navbar-brand img {
+ .my-navbar img {
margin-left: 235px;
}
}
\ No newline at end of file
diff --git a/lab4/src/components/navigation/Navigation.jsx b/lab4/src/components/navigation/Navigation.jsx
index 0fa8815..bcd71cd 100644
--- a/lab4/src/components/navigation/Navigation.jsx
+++ b/lab4/src/components/navigation/Navigation.jsx
@@ -1,32 +1,39 @@
import PropTypes from 'prop-types';
import { Container, Nav, Navbar, Button } from 'react-bootstrap';
-import { Link } from 'react-router-dom';
+import { Link, useLocation } from 'react-router-dom';
import './Navigation.css';
-const Navigation = () => {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
+const Navigation = ({ routes }) => {
+ const location = useLocation();
+ const indexPageLink = routes.filter((route) => route.index === false).shift();
+ const pages = routes.filter((route) => Object.prototype.hasOwnProperty.call(route, 'title'));
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
};
Navigation.propTypes = {
diff --git a/lab4/src/main.jsx b/lab4/src/main.jsx
index d557097..75e6a39 100644
--- a/lab4/src/main.jsx
+++ b/lab4/src/main.jsx
@@ -1,18 +1,38 @@
-import React from 'react'
-import ReactDOM from 'react-dom/client'
+import 'bootstrap/dist/css/bootstrap.min.css';
+import React from 'react';
+import ReactDOM from 'react-dom/client';
import { RouterProvider, createBrowserRouter } from 'react-router-dom';
-import App from './App.jsx'
-import './index.css'
-import Navigation from './components/navigation/Navigation.jsx';
+import App from './App.jsx';
+import './index.css';
import ErrorPage from './pages/ErrorPage.jsx';
+import Index from './pages/index.jsx';
const routes = [
{
index: true,
path: '/',
- element: ,
+ element: ,
title: 'Главная страница',
},
+ {
+ path: '/page2',
+ element: ,
+ title: 'Вторая страница',
+ },
+ {
+ path: '/page3',
+ element: ,
+ title: 'Третья страница',
+ },
+ {
+ path: '/page4',
+ element: ,
+ title: 'Четвертая страница',
+ },
+ {
+ path: '/page-edit',
+ element: ,
+ },
];
const router = createBrowserRouter([
diff --git a/lab4/src/pages/index.jsx b/lab4/src/pages/index.jsx
new file mode 100644
index 0000000..ee678ca
--- /dev/null
+++ b/lab4/src/pages/index.jsx
@@ -0,0 +1,34 @@
+import { Link } from 'react-router-dom';
+
+const Index = () => {
+ return (
+ <>
+ <>
+
Пример web-страницы.
+ 1. Структурные элементы
+ Полужирное начертание курсив
+ Абзац 2 Ссылка
+ 1.1. Списки
+
+ Список маркированный:
+
+
+
+ Список нумерованный:
+
+
+ - Элемент списка 1
+ - Элемент списка 2
+ - ...
+
+ >
+ >
+ );
+};
+
+export default Index;