Рефакторинг: Projects, News, индексирование, папки

This commit is contained in:
ifraimka1 committed 2024-02-16 12:57:07 +03:00
1 parent e4dd391568
commit e164d515bb
19 files changed
+140 -62

No files matched your search

@@ -0,0 +1,14 @@
import { Link } from 'react-router-dom';
function ProjectCard({ project }) {
return (
<Link className="card" to={`/projects`}>
<img className="image" alt="project_image" src={project.image}></img>
<div className="link-label">
Перейти&rarr;
</div>
</Link>
);
}
export default ProjectCard;
+36
View File
@@ -0,0 +1,36 @@
import BlockHeading from '../BlockHeading';
import ProjectCard from './ProjectCard';
import './Projects.styles.scss';
import { projectMock } from '../../../../images';
const mock = [
{
image: projectMock,
link: "/projects",
},
{
image: projectMock,
link: "/projects",
},
{
image: projectMock,
link: "/projects",
},
{
image: projectMock,
link: "/projects",
},
];
function Projects({ projects = mock }) {
return (
<div className="block projects">
<BlockHeading heading="Наши проекты" linkText="Все проекты" link="/projects"/>
<div className="row">
{ mock.map(item => <ProjectCard project={ item } />) }
</div>
</div>
);
}
export default Projects;
+44
View File
@@ -0,0 +1,44 @@
.projects {
.row {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
row-gap: 32px;
.card:first-of-type {
width: 100%;
aspect-ratio: 3;
}
.card {
display: block;
position: relative;
width: calc(100%/3 - 64px);
aspect-ratio: 3/2;
.image {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 8px;
}
.link-label {
position: absolute;
right: 24px;
bottom: 16px;
padding: 2px;
border-radius: 4px;
font-size: 20px;
font-weight: 500;
line-height: 24px;
color: #767676;
background-color: rgba(255, 255, 255, 0.75);
}
}
}
}
@@ -0,0 +1 @@
export { default } from './Projects';