@megafon/ui-shared 2.0.0-beta.223 → 2.0.0-beta.227
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +59 -0
- package/dist/es/components/BenefitsIcons/BenefitsIcons.d.ts +2 -0
- package/dist/es/components/BenefitsIcons/BenefitsIcons.js +4 -1
- package/dist/es/components/BenefitsIcons/style/BenefitsIcons.css +1 -1
- package/dist/es/components/BenefitsIcons/style/BenefitsIconsTile.css +2 -2
- package/dist/es/components/BenefitsPictures/BenfitsPictures.css +1 -1
- package/dist/es/components/Breadcrumbs/Breadcrumbs.css +1 -1
- package/dist/es/components/ButtonBanner/ButtonBanner.css +6 -6
- package/dist/es/components/Card/Card.css +16 -12
- package/dist/es/components/Card/Card.d.ts +2 -2
- package/dist/es/components/Card/Card.js +4 -5
- package/dist/es/components/Container/Container.css +26 -18
- package/dist/es/components/Instructions/Instructions.css +42 -32
- package/dist/es/components/Instructions/Instructions.js +9 -23
- package/dist/es/components/PageTitle/PageTitle.css +7 -7
- package/dist/es/components/PageTitle/PageTitle.js +12 -7
- package/dist/es/components/Partners/Partners.css +2 -2
- package/dist/es/components/PictureWithDescription/PictureWithDescription.css +2 -2
- package/dist/es/components/Property/Property.css +12 -12
- package/dist/es/components/Property/PropertyDescription.css +1 -1
- package/dist/es/components/Steps/Steps.css +2 -2
- package/dist/es/components/Steps/StepsItem.css +3 -3
- package/dist/es/components/StoreBanner/StoreBanner.css +51 -8
- package/dist/es/components/StoreBanner/StoreBanner.d.ts +11 -2
- package/dist/es/components/StoreBanner/StoreBanner.js +39 -19
- package/dist/es/components/StoreButton/StoreButton.css +5 -2
- package/dist/es/components/StoreButton/StoreButton.d.ts +2 -1
- package/dist/es/components/StoreButton/StoreButton.js +1 -0
- package/dist/es/components/StoreButton/img/huawei-store.png +0 -0
- package/dist/es/components/Table/Table.css +48 -48
- package/dist/es/components/TextBox/TextBoxPicture.css +23 -0
- package/dist/es/components/TextBox/TextBoxPicture.d.ts +17 -0
- package/dist/es/components/TextBox/TextBoxPicture.js +31 -0
- package/dist/es/components/VideoBanner/VideoBanner.css +8 -9
- package/dist/es/components/VideoBlock/VideoBlock.css +3 -3
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +1 -0
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.d.ts +2 -0
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.js +4 -1
- package/dist/lib/components/BenefitsIcons/style/BenefitsIcons.css +1 -1
- package/dist/lib/components/BenefitsIcons/style/BenefitsIconsTile.css +2 -2
- package/dist/lib/components/BenefitsPictures/BenfitsPictures.css +1 -1
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.css +1 -1
- package/dist/lib/components/ButtonBanner/ButtonBanner.css +6 -6
- package/dist/lib/components/Card/Card.css +16 -12
- package/dist/lib/components/Card/Card.d.ts +2 -2
- package/dist/lib/components/Card/Card.js +3 -4
- package/dist/lib/components/Container/Container.css +26 -18
- package/dist/lib/components/Instructions/Instructions.css +42 -32
- package/dist/lib/components/Instructions/Instructions.js +8 -25
- package/dist/lib/components/PageTitle/PageTitle.css +7 -7
- package/dist/lib/components/PageTitle/PageTitle.js +12 -7
- package/dist/lib/components/Partners/Partners.css +2 -2
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.css +2 -2
- package/dist/lib/components/Property/Property.css +12 -12
- package/dist/lib/components/Property/PropertyDescription.css +1 -1
- package/dist/lib/components/Steps/Steps.css +2 -2
- package/dist/lib/components/Steps/StepsItem.css +3 -3
- package/dist/lib/components/StoreBanner/StoreBanner.css +51 -8
- package/dist/lib/components/StoreBanner/StoreBanner.d.ts +11 -2
- package/dist/lib/components/StoreBanner/StoreBanner.js +38 -18
- package/dist/lib/components/StoreButton/StoreButton.css +5 -2
- package/dist/lib/components/StoreButton/StoreButton.d.ts +2 -1
- package/dist/lib/components/StoreButton/StoreButton.js +1 -0
- package/dist/lib/components/StoreButton/img/huawei-store.png +0 -0
- package/dist/lib/components/Table/Table.css +48 -48
- package/dist/lib/components/TextBox/TextBoxPicture.css +23 -0
- package/dist/lib/components/TextBox/TextBoxPicture.d.ts +17 -0
- package/dist/lib/components/TextBox/TextBoxPicture.js +48 -0
- package/dist/lib/components/VideoBanner/VideoBanner.css +8 -9
- package/dist/lib/components/VideoBlock/VideoBlock.css +3 -3
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +8 -0
- package/package.json +9 -12
@@ -4,12 +4,10 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import React from 'react';
|
5
5
|
import PropTypes from 'prop-types';
|
6
6
|
import "./Instructions.css";
|
7
|
-
import throttle from 'lodash.throttle';
|
8
7
|
import convert from 'htmr';
|
9
8
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
10
9
|
import { Grid, GridColumn, Header, Paragraph } from '@megafon/ui-core';
|
11
|
-
import {
|
12
|
-
var THROTTLE_MILLISECONDS = 100;
|
10
|
+
import { cnCreate } from '@megafon/ui-helpers';
|
13
11
|
export var pictureAlignTypes = {
|
14
12
|
LEFT: 'left',
|
15
13
|
RIGHT: 'right'
|
@@ -55,11 +53,6 @@ var Instructions = function Instructions(_ref) {
|
|
55
53
|
slideIndex = _React$useState4[0],
|
56
54
|
setSlideIndex = _React$useState4[1];
|
57
55
|
|
58
|
-
var _React$useState5 = React.useState(false),
|
59
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
60
|
-
isMobile = _React$useState6[0],
|
61
|
-
setIsMobile = _React$useState6[1];
|
62
|
-
|
63
56
|
var getSwiperInstance = React.useCallback(function (swiper) {
|
64
57
|
setSwiperInstance(swiper);
|
65
58
|
getSwiper && getSwiper(swiper);
|
@@ -71,10 +64,6 @@ var Instructions = function Instructions(_ref) {
|
|
71
64
|
|
72
65
|
return articleIndex === activeIndex ? "".concat(instructionItem, " ").concat(activeInstructionItem) : instructionItem;
|
73
66
|
}, [instructionItem, activeInstructionItem]);
|
74
|
-
var handleResize = React.useCallback(function () {
|
75
|
-
var isMobileScreen = window.innerWidth < breakpoints.DESKTOP_SMALL_START;
|
76
|
-
setIsMobile(isMobileScreen);
|
77
|
-
}, []);
|
78
67
|
var handleArticleClick = React.useCallback(function (ind) {
|
79
68
|
return function () {
|
80
69
|
setSlideIndex(ind);
|
@@ -139,7 +128,8 @@ var Instructions = function Instructions(_ref) {
|
|
139
128
|
var renderDesktopArticles = React.useCallback(function () {
|
140
129
|
return /*#__PURE__*/React.createElement("ul", {
|
141
130
|
className: cn('articles-list', {
|
142
|
-
'text-after': !!text
|
131
|
+
'text-after': !!text,
|
132
|
+
desktop: true
|
143
133
|
})
|
144
134
|
}, instructionItems.map(function (_ref3, ind) {
|
145
135
|
var itemTitle = _ref3.title;
|
@@ -160,7 +150,11 @@ var Instructions = function Instructions(_ref) {
|
|
160
150
|
}));
|
161
151
|
}, [instructionItems, slideIndex, handleArticleClick, text]);
|
162
152
|
var renderMobileArticles = React.useCallback(function () {
|
163
|
-
return /*#__PURE__*/React.createElement(
|
153
|
+
return /*#__PURE__*/React.createElement("div", {
|
154
|
+
className: cn('articles-list', {
|
155
|
+
mobile: true
|
156
|
+
})
|
157
|
+
}, /*#__PURE__*/React.createElement("div", {
|
164
158
|
className: cn('articles-title-block')
|
165
159
|
}, instructionItems.map(function (_ref4, ind) {
|
166
160
|
var itemTitle = _ref4.title;
|
@@ -185,14 +179,6 @@ var Instructions = function Instructions(_ref) {
|
|
185
179
|
}, ind + 1));
|
186
180
|
})));
|
187
181
|
}, [instructionItems, slideIndex, handleArticleClick, text]);
|
188
|
-
React.useEffect(function () {
|
189
|
-
var handleSetThrottled = throttle(handleResize, THROTTLE_MILLISECONDS);
|
190
|
-
handleResize();
|
191
|
-
window.addEventListener('resize', handleSetThrottled);
|
192
|
-
return function () {
|
193
|
-
window.removeEventListener('resize', handleSetThrottled);
|
194
|
-
};
|
195
|
-
}, [handleResize]);
|
196
182
|
return /*#__PURE__*/React.createElement("div", {
|
197
183
|
className: cn({
|
198
184
|
mask: pictureMask
|
@@ -212,7 +198,7 @@ var Instructions = function Instructions(_ref) {
|
|
212
198
|
className: cn('articles', {
|
213
199
|
align: pictureAlign
|
214
200
|
})
|
215
|
-
}, renderTitle('desktop'),
|
201
|
+
}, renderTitle('desktop'), renderMobileArticles(), renderDesktopArticles(), text && renderText())))));
|
216
202
|
};
|
217
203
|
|
218
204
|
Instructions.propTypes = {
|
@@ -41,37 +41,37 @@ h5 {
|
|
41
41
|
display: inline-block;
|
42
42
|
margin-top: 16px;
|
43
43
|
padding: 2px 14px;
|
44
|
+
color: #FFFFFF;
|
44
45
|
font-weight: 500;
|
45
46
|
background-color: #731982;
|
46
|
-
color: #FFFFFF;
|
47
47
|
}
|
48
48
|
@media screen and (min-width: 1280px) {
|
49
|
-
.mfui-beta-page-
|
49
|
+
.mfui-beta-page-title__badge_under-breadcrumbs {
|
50
50
|
margin-top: 32px;
|
51
51
|
}
|
52
52
|
}
|
53
53
|
@media screen and (min-width: 1024px) and (max-width: 1279px) {
|
54
|
-
.mfui-beta-page-
|
54
|
+
.mfui-beta-page-title__badge_under-breadcrumbs {
|
55
55
|
margin-top: 24px;
|
56
56
|
}
|
57
57
|
}
|
58
58
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
59
|
-
.mfui-beta-page-
|
59
|
+
.mfui-beta-page-title__badge_under-breadcrumbs {
|
60
60
|
margin-top: 16px;
|
61
61
|
}
|
62
62
|
}
|
63
63
|
@media screen and (min-width: 1280px) {
|
64
|
-
.mfui-beta-page-
|
64
|
+
.mfui-beta-page-title__title_under-breadcrumbs {
|
65
65
|
margin-top: 60px;
|
66
66
|
}
|
67
67
|
}
|
68
68
|
@media screen and (min-width: 1024px) and (max-width: 1279px) {
|
69
|
-
.mfui-beta-page-
|
69
|
+
.mfui-beta-page-title__title_under-breadcrumbs {
|
70
70
|
margin-top: 50px;
|
71
71
|
}
|
72
72
|
}
|
73
73
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
74
|
-
.mfui-beta-page-
|
74
|
+
.mfui-beta-page-title__title_under-breadcrumbs {
|
75
75
|
margin-top: 45px;
|
76
76
|
}
|
77
77
|
}
|
@@ -16,14 +16,16 @@ var PageTitle = function PageTitle(_ref) {
|
|
16
16
|
_ref$classes = _ref.classes,
|
17
17
|
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
18
18
|
rootRef = _ref.rootRef;
|
19
|
+
var isBreadcrumbs = !!(breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length);
|
19
20
|
var renderPageTitle = React.useCallback(function () {
|
20
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
className: cn('badge')
|
21
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, badge && /*#__PURE__*/React.createElement("div", {
|
22
|
+
className: cn('badge', {
|
23
|
+
'under-breadcrumbs': isBreadcrumbs
|
24
|
+
})
|
25
25
|
}, badge), /*#__PURE__*/React.createElement(Header, {
|
26
|
-
className: cn('title'
|
26
|
+
className: cn('title', {
|
27
|
+
'under-breadcrumbs': isBreadcrumbs && !badge
|
28
|
+
}),
|
27
29
|
as: "h1"
|
28
30
|
}, title));
|
29
31
|
}, [breadcrumbs, classes, badge, title]);
|
@@ -38,7 +40,10 @@ var PageTitle = function PageTitle(_ref) {
|
|
38
40
|
return /*#__PURE__*/React.createElement("div", {
|
39
41
|
className: cn([className]),
|
40
42
|
ref: rootRef
|
41
|
-
},
|
43
|
+
}, (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && /*#__PURE__*/React.createElement(Breadcrumbs, {
|
44
|
+
items: breadcrumbs,
|
45
|
+
className: cn('breadcrumbs', [classes.breadcrumbs])
|
46
|
+
}), isFullWidth ? renderPageTitle() : renderPageTitleWithGrid());
|
42
47
|
};
|
43
48
|
|
44
49
|
PageTitle.propTypes = {
|
@@ -34,10 +34,10 @@ h5 {
|
|
34
34
|
}
|
35
35
|
@media screen and (min-width: 1024px) {
|
36
36
|
.mfui-beta-picture-with-description__picture {
|
37
|
-
width: 50%;
|
38
37
|
-webkit-box-ordinal-group: 3;
|
39
38
|
-ms-flex-order: 2;
|
40
39
|
order: 2;
|
40
|
+
width: 50%;
|
41
41
|
}
|
42
42
|
}
|
43
43
|
@media screen and (min-width: 1024px) {
|
@@ -61,10 +61,10 @@ h5 {
|
|
61
61
|
}
|
62
62
|
@media screen and (min-width: 1024px) {
|
63
63
|
.mfui-beta-picture-with-description__articles {
|
64
|
-
width: 50%;
|
65
64
|
-webkit-box-ordinal-group: 2;
|
66
65
|
-ms-flex-order: 1;
|
67
66
|
order: 1;
|
67
|
+
width: 50%;
|
68
68
|
}
|
69
69
|
}
|
70
70
|
@media screen and (min-width: 1024px) {
|
@@ -35,19 +35,19 @@ h5 {
|
|
35
35
|
display: flex;
|
36
36
|
}
|
37
37
|
.mfui-beta-property__icon {
|
38
|
+
display: inline-block;
|
38
39
|
width: 24px;
|
39
40
|
height: 24px;
|
40
|
-
overflow: hidden;
|
41
41
|
margin-right: 9px;
|
42
42
|
margin-left: 1px;
|
43
|
-
|
43
|
+
overflow: hidden;
|
44
44
|
vertical-align: bottom;
|
45
45
|
}
|
46
46
|
.mfui-beta-property__badge {
|
47
|
-
border-radius: 2px;
|
48
|
-
font-size: 12px;
|
49
47
|
padding: 2px 8px;
|
48
|
+
border-radius: 2px;
|
50
49
|
color: #FFFFFF;
|
50
|
+
font-size: 12px;
|
51
51
|
background: #FFA717;
|
52
52
|
}
|
53
53
|
.mfui-beta-property__inner {
|
@@ -70,18 +70,18 @@ h5 {
|
|
70
70
|
width: 100%;
|
71
71
|
}
|
72
72
|
.mfui-beta-property__value-wrapper {
|
73
|
-
width: 35%;
|
74
73
|
display: -webkit-box;
|
75
74
|
display: -ms-flexbox;
|
76
75
|
display: flex;
|
77
|
-
-
|
78
|
-
|
79
|
-
justify-content: flex-end;
|
76
|
+
-ms-flex-negative: 0;
|
77
|
+
flex-shrink: 0;
|
80
78
|
-webkit-box-align: start;
|
81
79
|
-ms-flex-align: start;
|
82
80
|
align-items: flex-start;
|
83
|
-
-
|
84
|
-
flex-
|
81
|
+
-webkit-box-pack: end;
|
82
|
+
-ms-flex-pack: end;
|
83
|
+
justify-content: flex-end;
|
84
|
+
width: 35%;
|
85
85
|
}
|
86
86
|
@media screen and (max-width: 479px) {
|
87
87
|
.mfui-beta-property__value-wrapper {
|
@@ -90,10 +90,10 @@ h5 {
|
|
90
90
|
}
|
91
91
|
}
|
92
92
|
.mfui-beta-property__value-wrapper_merged {
|
93
|
-
border-left: 1px solid #D8D8D8;
|
94
93
|
-webkit-box-align: center;
|
95
94
|
-ms-flex-align: center;
|
96
95
|
align-items: center;
|
96
|
+
border-left: 1px solid #D8D8D8;
|
97
97
|
}
|
98
98
|
.mfui-beta-property__desc {
|
99
99
|
margin-top: 8px;
|
@@ -105,9 +105,9 @@ h5 {
|
|
105
105
|
max-width: 234px;
|
106
106
|
white-space: pre-line;
|
107
107
|
text-align: right;
|
108
|
+
font-weight: 500;
|
108
109
|
font-size: 18px;
|
109
110
|
line-height: 24px;
|
110
|
-
font-weight: 500;
|
111
111
|
letter-spacing: 0.5px;
|
112
112
|
}
|
113
113
|
@media screen and (min-width: 1280px) {
|
@@ -7,8 +7,8 @@ h5 {
|
|
7
7
|
}
|
8
8
|
.mfui-beta-steps {
|
9
9
|
width: 66%;
|
10
|
-
margin-left: auto;
|
11
10
|
margin-right: auto;
|
11
|
+
margin-left: auto;
|
12
12
|
}
|
13
13
|
@media screen and (min-width: 1280px) {
|
14
14
|
.mfui-beta-steps {
|
@@ -24,9 +24,9 @@ h5 {
|
|
24
24
|
margin-bottom: 40px;
|
25
25
|
}
|
26
26
|
.mfui-beta-steps__list {
|
27
|
-
list-style: none;
|
28
27
|
margin: 0;
|
29
28
|
padding: 0;
|
29
|
+
list-style: none;
|
30
30
|
}
|
31
31
|
.mfui-beta-steps__item {
|
32
32
|
margin-bottom: 48px;
|
@@ -17,19 +17,19 @@ h5 {
|
|
17
17
|
display: -webkit-box;
|
18
18
|
display: -ms-flexbox;
|
19
19
|
display: flex;
|
20
|
+
-ms-flex-negative: 0;
|
21
|
+
flex-shrink: 0;
|
20
22
|
-webkit-box-align: center;
|
21
23
|
-ms-flex-align: center;
|
22
24
|
align-items: center;
|
23
25
|
-webkit-box-pack: center;
|
24
26
|
-ms-flex-pack: center;
|
25
27
|
justify-content: center;
|
26
|
-
-ms-flex-negative: 0;
|
27
|
-
flex-shrink: 0;
|
28
28
|
width: 40px;
|
29
29
|
height: 40px;
|
30
30
|
border-radius: 50%;
|
31
|
-
background-color: #00B956;
|
32
31
|
color: #FFFFFF;
|
32
|
+
background-color: #00B956;
|
33
33
|
}
|
34
34
|
.mfui-beta-steps-item__text-wrapper {
|
35
35
|
padding-top: 8px;
|
@@ -29,8 +29,8 @@ h5 {
|
|
29
29
|
background-image: url('./img/new-iphone.png');
|
30
30
|
}
|
31
31
|
.mfui-beta-store-banner_mask_new-iphone .mfui-beta-store-banner__screen {
|
32
|
-
z-index: 1;
|
33
32
|
top: 13px;
|
33
|
+
z-index: 1;
|
34
34
|
width: 87%;
|
35
35
|
}
|
36
36
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
@@ -110,9 +110,9 @@ h5 {
|
|
110
110
|
}
|
111
111
|
@media screen and (max-width: 767px) {
|
112
112
|
.mfui-beta-store-banner__content {
|
113
|
+
padding-right: 15px;
|
113
114
|
padding-bottom: 32px;
|
114
115
|
padding-left: 15px;
|
115
|
-
padding-right: 15px;
|
116
116
|
text-align: center;
|
117
117
|
}
|
118
118
|
}
|
@@ -122,12 +122,12 @@ h5 {
|
|
122
122
|
background-size: cover;
|
123
123
|
}
|
124
124
|
.mfui-beta-store-banner__device-wrapper {
|
125
|
-
width: 235px;
|
126
125
|
position: relative;
|
127
126
|
bottom: calc(2 * (32px - 1px));
|
127
|
+
width: 235px;
|
128
128
|
height: calc(100% + 2 * 32px + 30px);
|
129
|
-
margin-left: auto;
|
130
129
|
margin-right: auto;
|
130
|
+
margin-left: auto;
|
131
131
|
overflow: hidden;
|
132
132
|
}
|
133
133
|
@media screen and (min-width: 1024px) and (max-width: 1279px) {
|
@@ -187,17 +187,17 @@ h5 {
|
|
187
187
|
height: 35px;
|
188
188
|
}
|
189
189
|
}
|
190
|
-
.mfui-beta-store-banner__store-
|
190
|
+
.mfui-beta-store-banner__store-link:not(:last-child) {
|
191
191
|
margin-right: 16px;
|
192
192
|
margin-bottom: 10px;
|
193
193
|
}
|
194
194
|
.mfui-beta-store-banner__stores {
|
195
|
-
-webkit-box-flex: 1;
|
196
|
-
-ms-flex-positive: 1;
|
197
|
-
flex-grow: 1;
|
198
195
|
display: -webkit-box;
|
199
196
|
display: -ms-flexbox;
|
200
197
|
display: flex;
|
198
|
+
-webkit-box-flex: 1;
|
199
|
+
-ms-flex-positive: 1;
|
200
|
+
flex-grow: 1;
|
201
201
|
-ms-flex-wrap: wrap;
|
202
202
|
flex-wrap: wrap;
|
203
203
|
}
|
@@ -220,3 +220,46 @@ h5 {
|
|
220
220
|
-webkit-transform: translateX(-50%);
|
221
221
|
transform: translateX(-50%);
|
222
222
|
}
|
223
|
+
.mfui-beta-store-banner__links_three .mfui-beta-store-banner__qr-code {
|
224
|
+
-o-object-fit: contain;
|
225
|
+
object-fit: contain;
|
226
|
+
}
|
227
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
228
|
+
.mfui-beta-store-banner__links_three .mfui-beta-store-banner__qr-code {
|
229
|
+
width: 120px;
|
230
|
+
height: 120px;
|
231
|
+
}
|
232
|
+
}
|
233
|
+
@media screen and (min-width: 1280px) {
|
234
|
+
.mfui-beta-store-banner__links_three .mfui-beta-store-banner__qr-code {
|
235
|
+
max-width: 88px;
|
236
|
+
max-height: 88px;
|
237
|
+
}
|
238
|
+
}
|
239
|
+
@media screen and (min-width: 1024px) {
|
240
|
+
.mfui-beta-store-banner__links_three .mfui-beta-store-banner__qr-code + .mfui-beta-store-banner__stores {
|
241
|
+
-webkit-box-orient: horizontal;
|
242
|
+
-webkit-box-direction: normal;
|
243
|
+
-ms-flex-direction: row;
|
244
|
+
flex-direction: row;
|
245
|
+
-webkit-box-pack: start;
|
246
|
+
-ms-flex-pack: start;
|
247
|
+
justify-content: flex-start;
|
248
|
+
max-width: 305px;
|
249
|
+
}
|
250
|
+
}
|
251
|
+
.mfui-beta-store-banner__links_three .mfui-beta-store-banner__qr-code + .mfui-beta-store-banner__stores .mfui-beta-store-banner__store-link {
|
252
|
+
margin-right: 16px;
|
253
|
+
}
|
254
|
+
.mfui-beta-store-banner__links_three .mfui-beta-store-banner__qr-code + .mfui-beta-store-banner__stores .mfui-beta-store-banner__store-link:not(:first-child) {
|
255
|
+
margin-right: 0;
|
256
|
+
}
|
257
|
+
.mfui-beta-store-banner__links_three .mfui-beta-store-banner__store-link {
|
258
|
+
width: 119px;
|
259
|
+
height: 35px;
|
260
|
+
}
|
261
|
+
@media screen and (max-width: 1023px) {
|
262
|
+
.mfui-beta-store-banner__links_three .mfui-beta-store-banner__store-link:not(:first-child) {
|
263
|
+
margin-right: 0;
|
264
|
+
}
|
265
|
+
}
|
@@ -22,13 +22,21 @@ export interface IStoreBannerProps {
|
|
22
22
|
/** Текст */
|
23
23
|
text: string;
|
24
24
|
/** Ссылка на скачивание приложения в App Store */
|
25
|
-
linkApple
|
25
|
+
linkApple?: LinkHrefType;
|
26
26
|
/** Обработчик клика по ссылке в App Store */
|
27
27
|
onClickApple?: LinkOnClickType;
|
28
28
|
/** Ссылка на скачивание приложения в Google Play */
|
29
|
-
linkGoogle
|
29
|
+
linkGoogle?: LinkHrefType;
|
30
30
|
/** Обработчик клика по ссылке в Google Play */
|
31
31
|
onClickGoogle?: LinkOnClickType;
|
32
|
+
/** Ссылка на скачивание приложения в Huawei Store */
|
33
|
+
linkHuawei?: LinkHrefType;
|
34
|
+
/** Обработчик клика по ссылке в Huawei Store */
|
35
|
+
onClickHuawei?: LinkOnClickType;
|
36
|
+
/** Текст кнопки */
|
37
|
+
textButton?: string;
|
38
|
+
/** Ссылка для кнопки */
|
39
|
+
linkButton?: string;
|
32
40
|
/** Ссылка на картинку с QR-кодом */
|
33
41
|
qrCode?: string;
|
34
42
|
/** Цветовая тема компонента */
|
@@ -44,6 +52,7 @@ export interface IStoreBannerProps {
|
|
44
52
|
root?: string;
|
45
53
|
appleLink?: string;
|
46
54
|
googleLink?: string;
|
55
|
+
huaweiLink?: string;
|
47
56
|
};
|
48
57
|
/** Ссылка на корневой элемент */
|
49
58
|
rootRef?: React.Ref<HTMLDivElement>;
|
@@ -2,7 +2,7 @@ import "core-js/modules/es.object.values";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import * as React from 'react';
|
4
4
|
import PropTypes from 'prop-types';
|
5
|
-
import { Grid, GridColumn, Header, Paragraph } from '@megafon/ui-core';
|
5
|
+
import { Button, Grid, GridColumn, Header, Paragraph } from '@megafon/ui-core';
|
6
6
|
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
7
7
|
import StoreButton, { Theme as StoreButtonTheme } from "../StoreButton/StoreButton";
|
8
8
|
import "./StoreBanner.css";
|
@@ -17,28 +17,35 @@ export var DeviceMask = {
|
|
17
17
|
BLACK_IPHONE: 'black-iphone',
|
18
18
|
WHITE_IPHONE: 'white-iphone'
|
19
19
|
};
|
20
|
+
var DEFAULT_TEXT_BUTTON = 'Установите приложение';
|
20
21
|
var cn = cnCreate('mfui-beta-store-banner');
|
21
22
|
|
22
23
|
var StoreBanner = function StoreBanner(_ref) {
|
23
|
-
var
|
24
|
+
var className = _ref.className,
|
25
|
+
_ref$classes = _ref.classes;
|
26
|
+
_ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
|
27
|
+
var rootClassName = _ref$classes.root,
|
28
|
+
appleLinkClassName = _ref$classes.appleLink,
|
29
|
+
googleLinkClassName = _ref$classes.googleLink,
|
30
|
+
huaweiLinkClassName = _ref$classes.huaweiLink,
|
31
|
+
title = _ref.title,
|
24
32
|
text = _ref.text,
|
25
33
|
linkApple = _ref.linkApple,
|
26
|
-
onClickApple = _ref.onClickApple,
|
27
34
|
linkGoogle = _ref.linkGoogle,
|
28
|
-
|
35
|
+
linkHuawei = _ref.linkHuawei,
|
36
|
+
linkButton = _ref.linkButton,
|
37
|
+
_ref$textButton = _ref.textButton,
|
38
|
+
textButton = _ref$textButton === void 0 ? DEFAULT_TEXT_BUTTON : _ref$textButton,
|
29
39
|
qrCode = _ref.qrCode,
|
30
40
|
imageSrc = _ref.imageSrc,
|
31
41
|
_ref$theme = _ref.theme,
|
32
42
|
theme = _ref$theme === void 0 ? Theme.CLEAR_WHITE : _ref$theme,
|
33
43
|
deviceMask = _ref.deviceMask,
|
34
|
-
className = _ref.className,
|
35
|
-
_ref$classes = _ref.classes;
|
36
|
-
_ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
|
37
|
-
var rootClassName = _ref$classes.root,
|
38
|
-
appleLinkClassName = _ref$classes.appleLink,
|
39
|
-
googleLinkClassName = _ref$classes.googleLink,
|
40
44
|
rootRef = _ref.rootRef,
|
41
|
-
dataAttrs = _ref.dataAttrs
|
45
|
+
dataAttrs = _ref.dataAttrs,
|
46
|
+
onClickApple = _ref.onClickApple,
|
47
|
+
onClickGoogle = _ref.onClickGoogle,
|
48
|
+
onClickHuawei = _ref.onClickHuawei;
|
42
49
|
return /*#__PURE__*/React.createElement("div", _extends({
|
43
50
|
className: cn({
|
44
51
|
theme: theme,
|
@@ -64,28 +71,41 @@ var StoreBanner = function StoreBanner(_ref) {
|
|
64
71
|
hasMargin: false,
|
65
72
|
color: "inherit"
|
66
73
|
}, text), /*#__PURE__*/React.createElement("div", {
|
67
|
-
className: cn('links'
|
68
|
-
|
74
|
+
className: cn('links', {
|
75
|
+
'three': !!linkApple && !!linkGoogle && !!linkHuawei
|
76
|
+
})
|
77
|
+
}, !linkButton && qrCode && /*#__PURE__*/React.createElement("img", {
|
69
78
|
src: qrCode,
|
70
79
|
className: cn('qr-code'),
|
71
80
|
alt: "QR-\u043A\u043E\u0434"
|
72
|
-
}), /*#__PURE__*/React.createElement("div", {
|
81
|
+
}), !linkButton && /*#__PURE__*/React.createElement("div", {
|
73
82
|
className: cn('stores')
|
74
|
-
}, /*#__PURE__*/React.createElement(StoreButton, {
|
83
|
+
}, linkApple && /*#__PURE__*/React.createElement(StoreButton, {
|
75
84
|
theme: StoreButtonTheme.APP_STORE,
|
76
85
|
href: linkApple,
|
77
86
|
onClick: onClickApple,
|
78
87
|
className: cn('store-link', {
|
79
88
|
'app-store': true
|
80
89
|
}, appleLinkClassName)
|
81
|
-
}), /*#__PURE__*/React.createElement(StoreButton, {
|
90
|
+
}), linkGoogle && /*#__PURE__*/React.createElement(StoreButton, {
|
82
91
|
theme: StoreButtonTheme.GOOGLE_PLAY,
|
83
92
|
href: linkGoogle,
|
84
93
|
className: cn('store-link', {
|
85
94
|
'google-play': true
|
86
95
|
}, googleLinkClassName),
|
87
96
|
onClick: onClickGoogle
|
88
|
-
})
|
97
|
+
}), linkHuawei && /*#__PURE__*/React.createElement(StoreButton, {
|
98
|
+
theme: StoreButtonTheme.HUAWEI_STORE,
|
99
|
+
href: linkHuawei,
|
100
|
+
className: cn('store-link', {
|
101
|
+
'huawei-store': true
|
102
|
+
}, huaweiLinkClassName),
|
103
|
+
onClick: onClickHuawei
|
104
|
+
})), linkButton && /*#__PURE__*/React.createElement(Button, {
|
105
|
+
className: cn('button'),
|
106
|
+
href: linkButton,
|
107
|
+
theme: theme === 'green' ? 'purple' : 'green'
|
108
|
+
}, textButton)))), /*#__PURE__*/React.createElement(GridColumn, {
|
89
109
|
all: "4",
|
90
110
|
desktop: "6",
|
91
111
|
tablet: "6",
|
@@ -104,9 +124,9 @@ var StoreBanner = function StoreBanner(_ref) {
|
|
104
124
|
StoreBanner.propTypes = {
|
105
125
|
title: PropTypes.string.isRequired,
|
106
126
|
text: PropTypes.string.isRequired,
|
107
|
-
linkApple: PropTypes.string
|
127
|
+
linkApple: PropTypes.string,
|
108
128
|
onClickApple: PropTypes.func,
|
109
|
-
linkGoogle: PropTypes.string
|
129
|
+
linkGoogle: PropTypes.string,
|
110
130
|
onClickGoogle: PropTypes.func,
|
111
131
|
qrCode: PropTypes.string,
|
112
132
|
theme: PropTypes.oneOf(Object.values(Theme)),
|
@@ -1,8 +1,8 @@
|
|
1
1
|
.mfui-beta-store-button {
|
2
|
-
|
2
|
+
border-radius: 8px;
|
3
3
|
background-repeat: no-repeat;
|
4
4
|
background-position: center;
|
5
|
-
|
5
|
+
background-size: cover;
|
6
6
|
}
|
7
7
|
.mfui-beta-store-button_theme_app-store {
|
8
8
|
background-image: url('./img/app-store.png');
|
@@ -10,3 +10,6 @@
|
|
10
10
|
.mfui-beta-store-button_theme_google-play {
|
11
11
|
background-image: url('./img/google-play.png');
|
12
12
|
}
|
13
|
+
.mfui-beta-store-button_theme_huawei-store {
|
14
|
+
background-image: url('./img/huawei-store.png');
|
15
|
+
}
|
@@ -3,7 +3,8 @@ import { Link } from '@megafon/ui-core';
|
|
3
3
|
import './StoreButton.less';
|
4
4
|
export declare enum Theme {
|
5
5
|
GOOGLE_PLAY = "google-play",
|
6
|
-
APP_STORE = "app-store"
|
6
|
+
APP_STORE = "app-store",
|
7
|
+
HUAWEI_STORE = "huawei-store"
|
7
8
|
}
|
8
9
|
declare type LinkPropTypes = React.ComponentProps<typeof Link>;
|
9
10
|
export declare type Props = Required<Pick<LinkPropTypes, 'href'>> & Pick<LinkPropTypes, 'onClick'> & {
|
Binary file
|