Skip to content

Commit 1357410

Browse files
Uzhastin-Nikitathe-homeless-god
authored andcommitted
feat: relocate Benefit component from web
1 parent 54ee8a4 commit 1357410

File tree

7 files changed

+303
-0
lines changed

7 files changed

+303
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
export type Benefit = {
2+
header: string
3+
content: string
4+
svgUrl: string
5+
}
6+
7+
export const BENEFITS: Benefit[][] = [
8+
[
9+
{
10+
svgUrl: 'images/benefit/dollar.svg',
11+
header: 'Доступность',
12+
content: 'Мы внимательно подошли к формированию цены, чтобы Вы могли найти подходящее решение'
13+
}
14+
],
15+
[
16+
{
17+
svgUrl: 'images/benefit/guality.svg',
18+
header: 'Профессионализм',
19+
content: 'Мы - программисты и геймеры, которые понимают что нужно для максимального комфорта и эргономики!'
20+
}
21+
],
22+
[
23+
{
24+
svgUrl: 'images/benefit/tool.svg',
25+
header: 'Конфигурируемость',
26+
content:
27+
'Заменить видеокарту или добавить ОЗУ?' +
28+
' Без проблем, крышка поднимается так, что процесс установки комплектующих принесёт удовольствие!'
29+
}
30+
],
31+
[
32+
{
33+
svgUrl: 'images/benefit/modules.svg',
34+
header: 'Модульность',
35+
content:
36+
'Ремонтопригодность - неотъемлая часть долгосрочной эксплуатации' +
37+
', если повредите стекло или опоры, то всегда сможете заказать их отдельно!'
38+
}
39+
],
40+
[
41+
{
42+
svgUrl: 'images/benefit/vector.svg',
43+
header: 'Гибкость',
44+
content: 'Хотите использовать свою сборку или поместить элементы декора? Мы поможем!'
45+
}
46+
],
47+
[
48+
{
49+
svgUrl: 'images/benefit/envelope.svg',
50+
header: 'Ваши предложения',
51+
// TODO: Добавить возможность перехода по ссылке
52+
content: 'В разделе Контакты есть вся необходимая информация, чтобы связаться с нами!'
53+
}
54+
]
55+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
@import 'src/scss/mixins';
2+
3+
.header,
4+
.benefit,
5+
.container {
6+
@include flex-center;
7+
}
8+
9+
.benefit {
10+
width: 380px;
11+
border-radius: 26px;
12+
background: $color-background-indigo;
13+
margin-top: 40px;
14+
15+
@include desktop {
16+
padding: 35px 0;
17+
position: relative;
18+
19+
&:hover .emergence {
20+
display: flex;
21+
}
22+
}
23+
24+
@include devices {
25+
display: flex;
26+
flex-flow: column;
27+
}
28+
29+
@include tablet {
30+
width: 380px;
31+
height: 280px;
32+
}
33+
}
34+
35+
.benefit,
36+
.emergence {
37+
cursor: pointer;
38+
}
39+
40+
.header {
41+
@include desktop {
42+
width: 380px;
43+
flex-flow: column;
44+
}
45+
46+
@include tablet {
47+
width: 90%;
48+
justify-content: space-evenly;
49+
flex-flow: row-reverse;
50+
}
51+
}
52+
53+
.img {
54+
width: 100px;
55+
height: 100px;
56+
margin: 30px;
57+
58+
@include devices {
59+
width: 80px;
60+
height: 80px;
61+
margin: 10px;
62+
}
63+
}
64+
65+
.title {
66+
color: $color-white;
67+
font-family: $font-lato;
68+
font-size: 30px;
69+
font-weight: 700;
70+
line-height: 36px;
71+
72+
@include desktop {
73+
font-size: 30px;
74+
}
75+
76+
@include tablet {
77+
font-size: 20px;
78+
}
79+
}
80+
81+
.container {
82+
@include desktop {
83+
width: 380px;
84+
}
85+
86+
@include tablet {
87+
width: 355px;
88+
}
89+
}
90+
91+
.content {
92+
color: $color-light;
93+
font-family: $font-lato;
94+
font-size: 24px;
95+
font-weight: 400;
96+
line-height: 32px;
97+
margin: 10px;
98+
padding: 15px;
99+
100+
@include tablet {
101+
font-size: 16px;
102+
margin: 0;
103+
padding: 13px;
104+
}
105+
}
106+
107+
.emergence {
108+
@include desktop {
109+
width: 100%;
110+
border-radius: 26px;
111+
align-items: center;
112+
left: 0;
113+
bottom: 0;
114+
right: 0;
115+
top: 0;
116+
display: none;
117+
position: absolute;
118+
background: $color-background-indigo;
119+
}
120+
121+
@include devices {
122+
display: flex;
123+
}
124+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import React from 'react'
2+
3+
import cx from 'classnames'
4+
5+
import { Image } from 'src/components/atoms/Image'
6+
7+
import css from './Benefit.styles.module.scss'
8+
9+
export type BenefitProps = {
10+
className?: string
11+
headerClassName?: string
12+
imgClassName?: string
13+
titleClassName?: string
14+
emergenceClassName?: string
15+
containerClassName?: string
16+
contentClassName?: string
17+
header: string
18+
content: string
19+
svgUrl: string
20+
}
21+
22+
export const Benefit = ({
23+
header,
24+
content,
25+
svgUrl,
26+
className,
27+
headerClassName,
28+
imgClassName,
29+
titleClassName,
30+
emergenceClassName,
31+
containerClassName,
32+
contentClassName
33+
}: BenefitProps) => {
34+
return (
35+
<div className={cx(css.benefit, className)}>
36+
<div className={cx(css.header, headerClassName)}>
37+
<Image className={cx(css.img, imgClassName)} src={svgUrl} />
38+
<span className={cx(css.title, titleClassName)}>{header}</span>
39+
</div>
40+
41+
<div className={cx(css.emergence, emergenceClassName)}>
42+
<div className={cx(css.container, containerClassName)}>
43+
<span className={cx(css.content, contentClassName)}>{content}</span>
44+
</div>
45+
</div>
46+
</div>
47+
)
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './Benefit'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@import 'src/scss/mixins';
2+
3+
.benefits {
4+
@include flex-center;
5+
6+
flex-flow: wrap;
7+
width: 100%;
8+
margin-top: 100px;
9+
margin-bottom: 50px;
10+
11+
@include mobile {
12+
display: none;
13+
}
14+
}
15+
16+
.container {
17+
display: grid;
18+
grid-template-columns: 380px 380px 380px;
19+
grid-template-rows: 280px 280px;
20+
grid-gap: 40px;
21+
margin-top: 50px;
22+
23+
@include tablet {
24+
grid-template-columns: 380px 380px;
25+
grid-template-rows: 280px 280px;
26+
grid-template-rows: 17em 17em;
27+
grid-gap: 40px;
28+
}
29+
}
30+
31+
.title {
32+
width: 100%;
33+
display: block;
34+
text-align: left;
35+
margin: 70px 0 30px;
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import React from 'react'
2+
3+
import cx from 'classnames'
4+
5+
import { TitleBlock } from 'src/components/atoms/TitleBlock'
6+
7+
import { Benefit } from './Benefit'
8+
import { BENEFITS } from './Benefit.utils'
9+
10+
import css from './Benefits.styles.module.scss'
11+
12+
export const Benefits = () => {
13+
return (
14+
<div className={css.benefits}>
15+
<div className={cx(css.title)}>
16+
<TitleBlock simpleText="Наши" highlightText="преимущества" />
17+
</div>
18+
<div className={cx(css.container)}>
19+
{BENEFITS.map((row, rowIndex) => {
20+
return (
21+
<div key={`benefit-row-${rowIndex}`}>
22+
{row.map((column, columnIndex) => {
23+
return (
24+
<Benefit
25+
key={`benefit-column-${columnIndex}`}
26+
header={column.header}
27+
content={column.content}
28+
svgUrl={column.svgUrl}
29+
/>
30+
)
31+
})}
32+
</div>
33+
)
34+
})}
35+
</div>
36+
</div>
37+
)
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './Benefits'

0 commit comments

Comments
 (0)