From 3d01506f914629532d6d3f8dfee0025f2c911aea Mon Sep 17 00:00:00 2001 From: Ifraim Solomonov Date: Tue, 27 Feb 2024 16:16:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D0=B0=D0=BD=20=D0=9D=D0=B0=D0=B2=D0=B1=D0=B0=D1=80,=20=D0=BB?= =?UTF-8?q?=D0=BE=D0=B3=D0=BE=D1=82=D0=B8=D0=BF=20=D1=82=D0=B5=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D1=8C=20=D1=8F=D0=B2=D0=BB=D1=8F=D0=B5=D1=82=D1=81=D1=8F?= =?UTF-8?q?=20=D1=81=D1=81=D1=8B=D0=BB=D0=BA=D0=BE=D0=B9=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=B3=D0=BB=D0=B0=D0=B2=D0=BD=D1=83=D1=8E=20=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=86=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Navbar/Navbar.jsx | 15 +++++++++------ src/components/Navbar/NavbarLink.jsx | 14 ++++++++++---- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/components/Navbar/Navbar.jsx b/src/components/Navbar/Navbar.jsx index 56a8402..728b4c4 100755 --- a/src/components/Navbar/Navbar.jsx +++ b/src/components/Navbar/Navbar.jsx @@ -1,11 +1,12 @@ import { scb as logo } from '../../images'; +import { NavLink } from "react-router-dom"; import NavbarLink from './NavbarLink'; import './Navbar.styles.scss'; const mock = [ { text: "НОВОСТИ", - to: "/", + to: "/news", }, { text: "О НАС", @@ -26,18 +27,20 @@ const mock = [ { text: "ИКТИБ", to: "https://ictis.sfedu.ru", - newTab: true, + newTab: true, }, ]; function Navbar({ links = mock }) { return (
-
- SCB logo -
+ +
+ SCB logo +
+
- { links.map(link => ) } + {links.map(link => )}
); diff --git a/src/components/Navbar/NavbarLink.jsx b/src/components/Navbar/NavbarLink.jsx index 4f431b6..034ee39 100755 --- a/src/components/Navbar/NavbarLink.jsx +++ b/src/components/Navbar/NavbarLink.jsx @@ -1,16 +1,22 @@ import { NavLink } from "react-router-dom"; +import { Children } from "react"; -function NavbarLink({ link }) { +function NavbarLink({ link, children }) { return ( `nav-link ${isActive ? 'active' : isPending ? 'disabled' : '' }` } - to={ link.to } - target={ link.newTab && '_blank' } + to={link.to} + target={link.newTab && '_blank'} > - { link.text } + {link.text} + {Children.map(children, (child) => ( + <> + {child} + + ))} ); }