mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 03:29:45 +00:00
Рефактор: пересобрал Navbar. В images добавил папку проектов, скорректировал mock
This commit is contained in:
1 parent
8d43bec068
commit
fb6c40f280
10 files changed
+88
-30
No files matched your search
@@ -1,33 +1,43 @@
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import { scb as logo } from '../../images';
|
||||
import NavbarLink from './NavbarLink';
|
||||
import './Navbar.styles.scss';
|
||||
|
||||
function Navbar() {
|
||||
const mock = [
|
||||
{
|
||||
text: "ГЛАВНАЯ",
|
||||
to: "/",
|
||||
},
|
||||
{
|
||||
text: "О НАС",
|
||||
to: "/aboutus",
|
||||
},
|
||||
{
|
||||
text: "ЛАБОРАТОРИИ",
|
||||
to: "/labs",
|
||||
},
|
||||
{
|
||||
text: "ПРОЕКТЫ",
|
||||
to: "/projects",
|
||||
},
|
||||
{
|
||||
text: "КОНТАКТЫ",
|
||||
to: "/contact",
|
||||
},
|
||||
{
|
||||
text: "ИКТИБ",
|
||||
to: "https://ictis.sfedu.ru",
|
||||
newTab: true,
|
||||
},
|
||||
];
|
||||
|
||||
function Navbar({ links = mock }) {
|
||||
return (
|
||||
<div className="navbar">
|
||||
<div className="logo-container">
|
||||
<img src={logo} className="logo" alt="SCB logo"/>
|
||||
</div>
|
||||
<div className="bar">
|
||||
<Link to={`/`}>
|
||||
ГЛАВНАЯ
|
||||
</Link>
|
||||
<Link to={`/aboutus`}>
|
||||
О НАС
|
||||
</Link>
|
||||
<Link to={`/labs`}>
|
||||
ЛАБОРАТОРИИ
|
||||
</Link>
|
||||
<Link to={`/projects`}>
|
||||
ПРОЕКТЫ
|
||||
</Link>
|
||||
<Link to={`/contact`}>
|
||||
КОНТАКТЫ
|
||||
</Link>
|
||||
<a href="https://ictis.sfedu.ru" target="_blank">
|
||||
ИКТИБ
|
||||
</a>
|
||||
{ links.map(link => <NavbarLink link={ link } />) }
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -26,8 +26,11 @@ $primary-text-color: white;
|
||||
|
||||
.bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.nav-link {
|
||||
position: relative;
|
||||
|
||||
a {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
line-height: 20px;
|
||||
@@ -36,6 +39,25 @@ $primary-text-color: white;
|
||||
margin-left: 40px;
|
||||
color: $primary-text-color;
|
||||
text-decoration: none;
|
||||
text-wrap: nowrap;
|
||||
}
|
||||
|
||||
.nav-link::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
bottom: 0;
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 1px;
|
||||
background: white;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.nav-link:hover:after,
|
||||
.nav-link.active:after {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { NavLink } from "react-router-dom";
|
||||
|
||||
function NavbarLink({ link }) {
|
||||
return (
|
||||
<NavLink
|
||||
className={({ isActive, isPending }) =>
|
||||
`nav-link ${isActive ? 'active' : isPending ? 'disabled' : ''
|
||||
}`
|
||||
}
|
||||
to={ link.to }
|
||||
target={ link.newTab && '_blank' }
|
||||
>
|
||||
{ link.text }
|
||||
</NavLink >
|
||||
);
|
||||
}
|
||||
|
||||
export default NavbarLink;
|
||||
@@ -1,4 +1,3 @@
|
||||
export { default as car } from './car.jpeg';
|
||||
export { default as newsMock } from './newsMock.png';
|
||||
export { default as projectMock } from './projectMock.png';
|
||||
export { default as scb } from './scb.svg';
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 814 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 713 KiB |
@@ -0,0 +1,4 @@
|
||||
export { default as drone } from './droneMock.jpeg';
|
||||
export { default as project } from './projectMock.png';
|
||||
export { default as ttt } from './3t.jpeg';
|
||||
export { default as comBattle } from './comBattle.jpeg';
|
||||
File renamed without changes.
|
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 1.6 MiB |
@@ -1,23 +1,28 @@
|
||||
import BlockHeading from '../BlockHeading';
|
||||
import ProjectCard from './ProjectCard';
|
||||
import './Projects.styles.scss';
|
||||
import { projectMock } from '../../../../images';
|
||||
import {
|
||||
project,
|
||||
drone,
|
||||
ttt,
|
||||
comBattle
|
||||
} from '../../../../images/projects';
|
||||
|
||||
const mock = [
|
||||
{
|
||||
image: projectMock,
|
||||
image: drone,
|
||||
link: "/projects",
|
||||
},
|
||||
{
|
||||
image: projectMock,
|
||||
image: ttt,
|
||||
link: "/projects",
|
||||
},
|
||||
{
|
||||
image: projectMock,
|
||||
image: comBattle,
|
||||
link: "/projects",
|
||||
},
|
||||
{
|
||||
image: projectMock,
|
||||
image: project,
|
||||
link: "/projects",
|
||||
},
|
||||
];
|
||||
@@ -25,9 +30,9 @@ const mock = [
|
||||
function Projects({ projects = mock }) {
|
||||
return (
|
||||
<div className="block projects">
|
||||
<BlockHeading heading="Наши проекты" linkText="Все проекты" link="/projects"/>
|
||||
<BlockHeading heading="Наши проекты" linkText="Все проекты" link="/projects" />
|
||||
<div className="row">
|
||||
{ mock.map(item => <ProjectCard project={ item } />) }
|
||||
{mock.map(item => <ProjectCard project={item} />)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user