@bytebrand/fe-ui-core 4.2.137 → 4.2.139
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/package.json +1 -1
- package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.tsx +2 -2
- package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.tsx +21 -12
- package/source/components/VehicleDetailedSidebar/partials/PriceContent.styl +2 -9
- package/source/components/VehicleDetailedSidebar/partials/PriceContent.tsx +3 -3
- package/source/framework/constants/common.ts +4 -2
package/package.json
CHANGED
package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.tsx
CHANGED
|
@@ -37,8 +37,8 @@ const RequestedCarsSection = ({ t, getSupportedImageFormat, requestedCars, redir
|
|
|
37
37
|
if (requestedCars && requestedCars.length > 0) {
|
|
38
38
|
const carsCard = requestedCars.map((car) => {
|
|
39
39
|
if (car && car.car) {
|
|
40
|
-
const { car: { mainData: { make
|
|
41
|
-
const { car: { _id, metaData: { mainImageId
|
|
40
|
+
const { car: { mainData: { make, model, subModel } } } = car;
|
|
41
|
+
const { car: { _id, metaData: { mainImageId } } } = car;
|
|
42
42
|
const { buyingType, paybackPeriod, monthlyInstallment, request, currentSalesPrice } = car;
|
|
43
43
|
const imageUrl = getSupportedImageFormat(_id, mainImageId, 'small');
|
|
44
44
|
return (
|
|
@@ -23,7 +23,7 @@ export interface IVehiclePriceProps {
|
|
|
23
23
|
size?: 'small' | 'semimedium' | 'medium' | 'large';
|
|
24
24
|
disableStyles?: boolean;
|
|
25
25
|
disablePrice?: boolean;
|
|
26
|
-
|
|
26
|
+
dynamicFontSize?: string;
|
|
27
27
|
|
|
28
28
|
// FormattedNumber props
|
|
29
29
|
toRound?: boolean;
|
|
@@ -38,12 +38,21 @@ const VehicleFormattedPrice: React.FunctionComponent<IVehiclePriceProps> = (prop
|
|
|
38
38
|
const textRef = useRef(null);
|
|
39
39
|
|
|
40
40
|
const updateFontSize = useCallback(() => {
|
|
41
|
-
if (price &&
|
|
41
|
+
if (price && dynamicFontSize && textRef.current) {
|
|
42
|
+
const textWidth = textRef.current.getBoundingClientRect().width;
|
|
42
43
|
const priceLength = Math.round(price).toString().length;
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
if (textWidth > 110) {
|
|
45
|
+
if (dynamicFontSize === 'small') {
|
|
46
|
+
const newSize = Math.min(60, 165 / priceLength);
|
|
47
|
+
textRef.current.style.fontSize = `${newSize}px`;
|
|
48
|
+
} else {
|
|
49
|
+
const newSize = Math.min(60, (165 / priceLength) + 6);
|
|
50
|
+
textRef.current.style.fontSize = `${newSize}px`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
}
|
|
45
54
|
}
|
|
46
|
-
}, [props.price, props.
|
|
55
|
+
}, [props.price, props.dynamicFontSize]);
|
|
47
56
|
|
|
48
57
|
useEffect(() => {
|
|
49
58
|
updateFontSize();
|
|
@@ -52,10 +61,10 @@ const VehicleFormattedPrice: React.FunctionComponent<IVehiclePriceProps> = (prop
|
|
|
52
61
|
function renderUnit(): React.ReactNode {
|
|
53
62
|
const { postfix, unit, unitClassName } = props;
|
|
54
63
|
return (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
<span className={classnames(styles.unit, unitClassName)}>
|
|
65
|
+
{unit}
|
|
66
|
+
{postfix ? renderPostfix() : ''}
|
|
67
|
+
</span>);
|
|
59
68
|
}
|
|
60
69
|
|
|
61
70
|
function renderUnitMonthly(): React.ReactNode {
|
|
@@ -93,7 +102,7 @@ const VehicleFormattedPrice: React.FunctionComponent<IVehiclePriceProps> = (prop
|
|
|
93
102
|
// FormattedNumber props
|
|
94
103
|
const {
|
|
95
104
|
unit, sub, numbersAfterDot, toRound, numberContainerClassName,
|
|
96
|
-
afterCommaClassName, beforeCommaClassName, disableFormatting, disablePrice,
|
|
105
|
+
afterCommaClassName, beforeCommaClassName, disableFormatting, disablePrice, dynamicFontSize
|
|
97
106
|
} = props;
|
|
98
107
|
|
|
99
108
|
const decimalsClass = classnames(afterCommaClassName, styles.decimals);
|
|
@@ -109,7 +118,7 @@ const VehicleFormattedPrice: React.FunctionComponent<IVehiclePriceProps> = (prop
|
|
|
109
118
|
disableFormatting,
|
|
110
119
|
numbersAfterDot,
|
|
111
120
|
toRound,
|
|
112
|
-
|
|
121
|
+
dynamicFontSize,
|
|
113
122
|
beforeCommaClassName,
|
|
114
123
|
value: price,
|
|
115
124
|
className: numberContainerClassName,
|
|
@@ -141,7 +150,7 @@ VehicleFormattedPrice.defaultProps = {
|
|
|
141
150
|
unitClassName: '',
|
|
142
151
|
postfixClassName: '',
|
|
143
152
|
subClassName: '',
|
|
144
|
-
|
|
153
|
+
dynamicFontSize: '',
|
|
145
154
|
sub: '',
|
|
146
155
|
// FormattedNumber props
|
|
147
156
|
toRound: false,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import '../../../theme/mixins.styl';
|
|
2
2
|
|
|
3
3
|
.newFinancingPriceWrapper
|
|
4
|
-
width:
|
|
4
|
+
width: 159px
|
|
5
5
|
display: flex
|
|
6
6
|
align-items: flex-start;
|
|
7
7
|
color: $lightGreen;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
font-size: 60px;
|
|
11
11
|
display flex;
|
|
12
12
|
line-height: .8;
|
|
13
|
-
margin 8px 0 0
|
|
13
|
+
margin 8px 0 0 10px;
|
|
14
14
|
[class^="VehicleFormattedPrice__decimals"], [class^="VehicleFormattedPrice__unit"]
|
|
15
15
|
font-size: 16px !important;
|
|
16
16
|
transform: none !important;
|
|
@@ -18,11 +18,9 @@
|
|
|
18
18
|
.tabContentPaddingForBuy
|
|
19
19
|
.newFinancingPriceWrapper
|
|
20
20
|
[class*="VehicleFormattedPrice__large"]
|
|
21
|
-
font-size: 40px;
|
|
22
21
|
margin-left: 0;
|
|
23
22
|
+media-phone-only()
|
|
24
23
|
[class*="VehicleFormattedPrice__large"]
|
|
25
|
-
font-size: 45px!important;
|
|
26
24
|
margin-left: 3px;
|
|
27
25
|
|
|
28
26
|
|
|
@@ -117,13 +115,8 @@
|
|
|
117
115
|
padding-right: 15px;
|
|
118
116
|
|
|
119
117
|
.priceFontSizeSmall
|
|
120
|
-
.financingPriceItem
|
|
121
|
-
display: block;
|
|
122
118
|
.priceInfoLabel
|
|
123
119
|
margin-top:8px!important
|
|
124
|
-
.wrapper
|
|
125
|
-
+media-tablet-landscape-up()
|
|
126
|
-
padding-right: 0px;
|
|
127
120
|
|
|
128
121
|
|
|
129
122
|
.tabContentPaddingForBuy.priceFontSizeSmall
|
|
@@ -46,7 +46,7 @@ const PriceContent: React.FunctionComponent<IPriceContentProps> = ({
|
|
|
46
46
|
isAdditionalOption: true,
|
|
47
47
|
onShowOfferDetails: offerBlockProps.onShowOfferDetails
|
|
48
48
|
};
|
|
49
|
-
const priceFontSize:string = monthlyInstallment ? (getFormattedPrice(monthlyInstallment)?.toString().match(/\d/g).length >= 4 ? 'small' :'large') :'';
|
|
49
|
+
const priceFontSize: string = monthlyInstallment ? (getFormattedPrice(monthlyInstallment)?.toString().match(/\d/g).length >= 4 ? 'small' : 'large') : '';
|
|
50
50
|
|
|
51
51
|
const tabContentPaddingClassName = classnames(
|
|
52
52
|
styles.tabContentPadding,
|
|
@@ -94,7 +94,7 @@ const PriceContent: React.FunctionComponent<IPriceContentProps> = ({
|
|
|
94
94
|
postfix={postfix}
|
|
95
95
|
numbersAfterDot={0}
|
|
96
96
|
size='large'
|
|
97
|
-
|
|
97
|
+
dynamicFontSize={tabContentPaddingClassName.includes('tabContentPaddingForBuy') ? 'large' : 'small'}
|
|
98
98
|
/>
|
|
99
99
|
</div>
|
|
100
100
|
) : null}
|
|
@@ -114,7 +114,7 @@ const PriceContent: React.FunctionComponent<IPriceContentProps> = ({
|
|
|
114
114
|
</span>
|
|
115
115
|
</div>
|
|
116
116
|
</div>
|
|
117
|
-
{offerBlockOpen && <OfferBlockComponent {...{ ...offerBlockProps, priceTabIndex: activeTab }} />
|
|
117
|
+
{offerBlockOpen && <OfferBlockComponent {...{ ...offerBlockProps, priceTabIndex: activeTab }} />}
|
|
118
118
|
<RequestOffer {...requestOfferProps} />
|
|
119
119
|
</>
|
|
120
120
|
);
|
|
@@ -27,7 +27,8 @@ export const COOKIE_SCHEMA_LINKS = {
|
|
|
27
27
|
Facebook: 'https://www.facebook.com/privacy/policies/cookies/?entry_point=cookie_policy_redirect&entry=0',
|
|
28
28
|
['Google Analytics']: 'http://datenschutzbestimmungen/',
|
|
29
29
|
Hotjar: 'https://www.hotjar.com/legal/policies/privacy/de/',
|
|
30
|
-
Microsoft: 'https://privacy.microsoft.com/de-de/privacystatement'
|
|
30
|
+
Microsoft: 'https://privacy.microsoft.com/de-de/privacystatement',
|
|
31
|
+
Matomo: 'https://matomo.org/privacy-policy/',
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
export const COOKIE_SCHEMA = {
|
|
@@ -82,7 +83,8 @@ export const COOKIE_SCHEMA = {
|
|
|
82
83
|
'_uetvid',
|
|
83
84
|
...GOOGLE_BUNDLE_COOKIES
|
|
84
85
|
],
|
|
85
|
-
Hotjar: ['hotjar']
|
|
86
|
+
Hotjar: ['hotjar'],
|
|
87
|
+
Matomo: ['MATOMO_SESSID','_pk_ses.1.4d04', '_pk_id.1.4d04']
|
|
86
88
|
|
|
87
89
|
},
|
|
88
90
|
marketing: {
|