@bytebrand/fe-ui-core 4.1.39 → 4.1.41
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/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.styl +19 -4
- package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +15 -4
- package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.styl +44 -0
- package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.tsx +29 -6
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +51 -1
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.tsx +46 -14
- package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +3 -3
- package/source/components/VehicleSmallCard/VehicleSmallCard.styl +21 -0
- package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +11 -4
- package/source/components/_common/Checkbox/Checkbox.tsx +1 -1
- package/source/framework/types/types.ts +13 -2
- package/source/framework/vehiclesProps/decoratedLightProps.tsx +44 -1
- package/source/framework/vehiclesProps/vehicleDetails.ts +21 -0
package/package.json
CHANGED
package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.styl
CHANGED
|
@@ -8,8 +8,14 @@
|
|
|
8
8
|
flex-shrink: 0;
|
|
9
9
|
height: 46px;
|
|
10
10
|
box-sizing: border-box;
|
|
11
|
+
|
|
12
|
+
&.priceItemFavorite
|
|
13
|
+
height: 44px;
|
|
14
|
+
|
|
11
15
|
+media-phone-up()
|
|
12
16
|
height: 42px;
|
|
17
|
+
&.priceItemFavorite
|
|
18
|
+
height: 42px;
|
|
13
19
|
|
|
14
20
|
&:first-of-type
|
|
15
21
|
align-items: flex-end;
|
|
@@ -22,9 +28,6 @@
|
|
|
22
28
|
&.priceItemCategorySearch
|
|
23
29
|
+media-tablet-landscape-up()
|
|
24
30
|
font-size: 12px;
|
|
25
|
-
&:last-of-type
|
|
26
|
-
border-top: 1px solid $grey-d3
|
|
27
|
-
padding-top: 12px;
|
|
28
31
|
&:nth-of-type(3), &:last-of-type
|
|
29
32
|
.tooltipWrap
|
|
30
33
|
&__block
|
|
@@ -37,6 +40,9 @@
|
|
|
37
40
|
&::after
|
|
38
41
|
transform: rotate(180deg) translateX(3px);
|
|
39
42
|
|
|
43
|
+
.priceItemBuy
|
|
44
|
+
border-top: 1px solid $grey-d3
|
|
45
|
+
|
|
40
46
|
.priceItemCategory
|
|
41
47
|
font-size: 12px
|
|
42
48
|
font-weight bold
|
|
@@ -59,6 +65,11 @@
|
|
|
59
65
|
+media-tablet-landscape-up()
|
|
60
66
|
font-size: 12px;
|
|
61
67
|
|
|
68
|
+
&.priceItemCategoryFavorite
|
|
69
|
+
+media-tablet-landscape-up()
|
|
70
|
+
font-size: 13px !important;
|
|
71
|
+
color: rgba(76, 78, 100, 0.87);
|
|
72
|
+
|
|
62
73
|
.priceItemDisable
|
|
63
74
|
pointer-events: none;
|
|
64
75
|
.priceItemCategory
|
|
@@ -131,4 +142,8 @@
|
|
|
131
142
|
.isAlternativeText
|
|
132
143
|
position: absolute;
|
|
133
144
|
font-size: 8px;
|
|
134
|
-
bottom: 5px;
|
|
145
|
+
bottom: 5px;
|
|
146
|
+
|
|
147
|
+
.tooltipWrapFavorites
|
|
148
|
+
transform: translateY(-1px);
|
|
149
|
+
margin-left: 5px;
|
package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx
CHANGED
|
@@ -16,7 +16,7 @@ export interface IVehiclePriceItemProps {
|
|
|
16
16
|
showAboIcon: Boolean;
|
|
17
17
|
isPriceDisable: Boolean;
|
|
18
18
|
isAlternativeText?: string;
|
|
19
|
-
vehicleComponentName?: 'comparable' | 'landing' | 'search' | 'main' | 'myVehicles';
|
|
19
|
+
vehicleComponentName?: 'comparable' | 'landing' | 'search' | 'main' | 'myVehicles' | 'favorite';
|
|
20
20
|
perMonthCurrent?: number;
|
|
21
21
|
iconName?: string;
|
|
22
22
|
perMonthOld?: number;
|
|
@@ -66,12 +66,15 @@ class VehiclePriceItem extends React.Component<IVehiclePriceItemProps> {
|
|
|
66
66
|
|
|
67
67
|
const stylesItem = classnames(
|
|
68
68
|
styles.priceItem,
|
|
69
|
-
{ [styles.
|
|
69
|
+
{ [styles.priceItemFavorite]: vehicleComponentName === 'favorite' },
|
|
70
|
+
{ [styles.priceItemDisable]: isPriceDisable },
|
|
71
|
+
{ [styles.priceItemBuy]: isTotal },
|
|
70
72
|
);
|
|
71
73
|
|
|
72
74
|
const priceItemCategoryClassName = classnames(
|
|
73
75
|
styles.priceItemCategory,
|
|
74
|
-
{ [styles.priceItemCategorySearch]: vehicleComponentName === 'search' || vehicleComponentName === 'myVehicles' }
|
|
76
|
+
{ [styles.priceItemCategorySearch]: vehicleComponentName === 'search' || vehicleComponentName === 'myVehicles' },
|
|
77
|
+
{ [styles.priceItemCategoryFavorite]: vehicleComponentName === 'favorite' }
|
|
75
78
|
);
|
|
76
79
|
return (
|
|
77
80
|
<div className={stylesItem}>
|
|
@@ -82,7 +85,15 @@ class VehiclePriceItem extends React.Component<IVehiclePriceItemProps> {
|
|
|
82
85
|
className: priceItemCategoryClassName,
|
|
83
86
|
href: url
|
|
84
87
|
})}
|
|
85
|
-
{tooltipDescription &&
|
|
88
|
+
{tooltipDescription && (
|
|
89
|
+
<Tooltip
|
|
90
|
+
tooltipClassName={vehicleComponentName === 'favorite' ? styles.tooltipWrapFavorites : ''}
|
|
91
|
+
description={tooltipDescription}
|
|
92
|
+
positionX={positionX}
|
|
93
|
+
positionY={positionY}
|
|
94
|
+
iconName={vehicleComponentName === 'favorite' ? 'infoIcon' : iconName}
|
|
95
|
+
/>
|
|
96
|
+
)}
|
|
86
97
|
{isNewPriceCategory && (
|
|
87
98
|
<span className={styles.priceNewBlock}>neu</span>
|
|
88
99
|
)}
|
|
@@ -152,6 +152,50 @@
|
|
|
152
152
|
height: 16px;
|
|
153
153
|
max-width: 25%;
|
|
154
154
|
|
|
155
|
+
&.vehiclePropertiesFavorite
|
|
156
|
+
grid-template-columns: 1fr;
|
|
157
|
+
display: grid;
|
|
158
|
+
grid-auto-rows: 44px;
|
|
159
|
+
|
|
160
|
+
& > .consumptionCombined
|
|
161
|
+
white-space: pre-line;
|
|
162
|
+
grid-row: 4;
|
|
163
|
+
|
|
164
|
+
+media-tablet-landscape-up()
|
|
165
|
+
grid-template-columns: 1fr 1fr 1fr;
|
|
166
|
+
margin-top: -13px;
|
|
167
|
+
padding: 0;
|
|
168
|
+
grid-auto-rows: 52px;
|
|
169
|
+
|
|
170
|
+
&:after
|
|
171
|
+
display none
|
|
172
|
+
|
|
173
|
+
& > .consumptionCombined,
|
|
174
|
+
& > div:last-of-type
|
|
175
|
+
grid-column: auto;
|
|
176
|
+
grid-row: auto;
|
|
177
|
+
|
|
178
|
+
& > .offerAvailability
|
|
179
|
+
border: none;
|
|
180
|
+
& + div
|
|
181
|
+
border: none;
|
|
182
|
+
|
|
183
|
+
& .carIconSearch
|
|
184
|
+
width: 23px;
|
|
185
|
+
height: 23px;
|
|
186
|
+
max-width: 23px;
|
|
187
|
+
|
|
188
|
+
& .priceRatingLabelSRL
|
|
189
|
+
font-size: 10px;
|
|
190
|
+
|
|
191
|
+
& .priceRatingSRL
|
|
192
|
+
margin: auto;
|
|
193
|
+
|
|
194
|
+
& .priceRatingSegmentWrapSRL > div
|
|
195
|
+
width: 24px
|
|
196
|
+
height: 16px;
|
|
197
|
+
max-width: 25%;
|
|
198
|
+
|
|
155
199
|
&.vehiclePropertiesMyVehicles
|
|
156
200
|
&::after
|
|
157
201
|
+media-tablet-landscape-down()
|
|
@@ -10,7 +10,8 @@ import getDecoratedProps from '../../../../framework/vehiclesProps/decoratedLigh
|
|
|
10
10
|
import {
|
|
11
11
|
getMainPropertiesForComparableCars,
|
|
12
12
|
getMainPropertiesForLandingCars,
|
|
13
|
-
getMainPropertiesForSRL
|
|
13
|
+
getMainPropertiesForSRL,
|
|
14
|
+
getMainPropertiesForFavorite
|
|
14
15
|
} from '../../../../framework/vehiclesProps/vehicleDetails';
|
|
15
16
|
import { IVehicleInfo } from '../../../../framework/types/types';
|
|
16
17
|
|
|
@@ -31,6 +32,11 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
|
|
|
31
32
|
routeObj,
|
|
32
33
|
mileage,
|
|
33
34
|
gearbox,
|
|
35
|
+
numberOfPreviousOwners,
|
|
36
|
+
usageType,
|
|
37
|
+
condition,
|
|
38
|
+
damaged,
|
|
39
|
+
driveType,
|
|
34
40
|
environmentEmissions,
|
|
35
41
|
consumption,
|
|
36
42
|
location,
|
|
@@ -46,10 +52,15 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
|
|
|
46
52
|
mileage,
|
|
47
53
|
location,
|
|
48
54
|
offer,
|
|
55
|
+
numberOfPreviousOwners,
|
|
56
|
+
usageType,
|
|
57
|
+
condition,
|
|
58
|
+
damaged,
|
|
49
59
|
firstRegistration: firstRegistrationDate
|
|
50
60
|
},
|
|
51
61
|
driveSuspension: {
|
|
52
|
-
gearbox
|
|
62
|
+
gearbox,
|
|
63
|
+
driveType
|
|
53
64
|
},
|
|
54
65
|
environmentEmissions: {
|
|
55
66
|
co2: environmentEmissions.co2
|
|
@@ -67,7 +78,7 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
|
|
|
67
78
|
icon: decoratedProps[prop].icon,
|
|
68
79
|
description: decoratedProps[prop].value,
|
|
69
80
|
className: styles[decoratedProps[prop].name],
|
|
70
|
-
classNameIcon: (vehicleComponentName === 'search' ||
|
|
81
|
+
classNameIcon: (vehicleComponentName === 'search' || 'myVehicles' || 'favorite') && styles.carIconSearch
|
|
71
82
|
}));
|
|
72
83
|
|
|
73
84
|
return mainPropertiesList.map((property: any, index: number) => (
|
|
@@ -81,6 +92,7 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
|
|
|
81
92
|
{ [styles.vehiclePropertiesLanding]: vehicleComponentName === 'landing' },
|
|
82
93
|
{ [styles.vehiclePropertiesMain]: vehicleComponentName === 'main' },
|
|
83
94
|
{ [styles.vehiclePropertiesSearch]: vehicleComponentName === 'search' },
|
|
95
|
+
{ [styles.vehiclePropertiesFavorite]: vehicleComponentName === 'favorite' },
|
|
84
96
|
{ [styles.vehiclePropertiesMyVehicles]: vehicleComponentName === 'myVehicles' },
|
|
85
97
|
{ [styles.vehiclePropertiesIsAlternative]: combineRefAlternative },
|
|
86
98
|
);
|
|
@@ -103,13 +115,24 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
|
|
|
103
115
|
</>
|
|
104
116
|
) : ''}
|
|
105
117
|
{vehicleComponentName === 'search' || vehicleComponentName === 'myVehicles' ? renderProperty(getMainPropertiesForSRL, vehicleComponentName): ''}
|
|
118
|
+
|
|
119
|
+
{vehicleComponentName === 'favorite' ? (
|
|
120
|
+
<>
|
|
121
|
+
<Visible xs sm md>
|
|
122
|
+
{renderProperty(getMainPropertiesForComparableCars)}
|
|
123
|
+
</Visible>
|
|
124
|
+
<Hidden xs sm md>
|
|
125
|
+
{renderProperty(getMainPropertiesForFavorite, vehicleComponentName)}
|
|
126
|
+
</Hidden>
|
|
127
|
+
</>
|
|
128
|
+
) : ''}
|
|
106
129
|
<PriceRating
|
|
107
130
|
t={t}
|
|
108
131
|
i18nPrefix={i18nPrefixForPriceRating ? `${i18nPrefixForPriceRating}priceRating.` : 'priceRating.'}
|
|
109
132
|
rating={getPriceRating(currentSalesPrice, mlCurrentSalesPricePredicted)}
|
|
110
|
-
className={`${styles.priceRating} ${vehicleComponentName === 'search' ||
|
|
111
|
-
classLabel={vehicleComponentName === 'search' ||
|
|
112
|
-
classSegmentWrapper={vehicleComponentName === 'search' ||
|
|
133
|
+
className={`${styles.priceRating} ${vehicleComponentName === 'search' || 'myVehicles' || 'favorite' ? styles.priceRatingSRL : ''}`}
|
|
134
|
+
classLabel={vehicleComponentName === 'search' || 'myVehicles' || 'favorite' ? styles.priceRatingLabelSRL : ''}
|
|
135
|
+
classSegmentWrapper={vehicleComponentName === 'search' || 'myVehicles' || 'favorite' ? styles.priceRatingSegmentWrapSRL : ''}
|
|
113
136
|
/>
|
|
114
137
|
</>
|
|
115
138
|
),
|
|
@@ -18,6 +18,14 @@
|
|
|
18
18
|
padding: 0 5px 0 15px;
|
|
19
19
|
border-left: 1px solid $grey-d
|
|
20
20
|
|
|
21
|
+
&.vehiclePriceSectionFavorite
|
|
22
|
+
padding: 0 10px 0 10px
|
|
23
|
+
+media-tablet-landscape-up()
|
|
24
|
+
flex-shrink: 0;
|
|
25
|
+
padding: 0 5px 0 15px;
|
|
26
|
+
border-left: 1px solid $grey-d
|
|
27
|
+
gap: 3px;
|
|
28
|
+
|
|
21
29
|
.vehiclePriceTitle
|
|
22
30
|
color: $grey-3
|
|
23
31
|
display block;
|
|
@@ -49,4 +57,46 @@
|
|
|
49
57
|
text-transform: uppercase !important
|
|
50
58
|
|
|
51
59
|
.isAlternativeButton
|
|
52
|
-
background-color: $alternative !important
|
|
60
|
+
background-color: $alternative !important
|
|
61
|
+
|
|
62
|
+
.wrapCheckbox
|
|
63
|
+
height: 42px;
|
|
64
|
+
& > div
|
|
65
|
+
order: 1;
|
|
66
|
+
& span
|
|
67
|
+
margin: 0 !important;
|
|
68
|
+
color: rgba(76, 78, 100, 0.87);
|
|
69
|
+
|
|
70
|
+
.wrapHandleCompare
|
|
71
|
+
display: flex;
|
|
72
|
+
gap: 8px;
|
|
73
|
+
border-top: 1px solid $grey-d3;
|
|
74
|
+
padding-top: 15px;
|
|
75
|
+
|
|
76
|
+
+media-tablet-landscape-up()
|
|
77
|
+
margin-top: 20px;
|
|
78
|
+
padding-top: 0;
|
|
79
|
+
border: none;
|
|
80
|
+
|
|
81
|
+
.btnCompareRemove
|
|
82
|
+
min-width: 50px !important;
|
|
83
|
+
height: 34px;
|
|
84
|
+
border: 1px solid #BA1A1A !important;
|
|
85
|
+
|
|
86
|
+
.btnCarToCompare
|
|
87
|
+
display: flex;
|
|
88
|
+
height: 34px;
|
|
89
|
+
align-items: center;
|
|
90
|
+
text-transform uppercase !important
|
|
91
|
+
width: 100%;
|
|
92
|
+
min-width: auto !important;
|
|
93
|
+
max-width: 100% !important;
|
|
94
|
+
|
|
95
|
+
.btnPlusIcon
|
|
96
|
+
font-size: 26px;
|
|
97
|
+
margin-right: 10px;
|
|
98
|
+
line-height: 32px;
|
|
99
|
+
|
|
100
|
+
.btnText
|
|
101
|
+
position: relative;
|
|
102
|
+
top: -4px;
|
|
@@ -5,6 +5,8 @@ import VehiclePriceItem from '../VechiclePriceItem/VechiclePriceItem';
|
|
|
5
5
|
import { IBuy, ILeasing, IFinancing, ICommonFinancing } from '../../../../framework/types/types';
|
|
6
6
|
import { Hidden } from 'react-grid-system';
|
|
7
7
|
import Button from '../../../../components/_common/Button/Button';
|
|
8
|
+
import Checkbox from '../../../../components/_common/Checkbox/Checkbox';
|
|
9
|
+
import IconSVG from '../../../_common/IconSVG/IconSVG';
|
|
8
10
|
|
|
9
11
|
export interface IVehiclePriceSectionProps {
|
|
10
12
|
t?: (key: string, options?: object) => string;
|
|
@@ -18,7 +20,7 @@ export interface IVehiclePriceSectionProps {
|
|
|
18
20
|
linkTag?: string;
|
|
19
21
|
showAboIcon?: boolean;
|
|
20
22
|
isNewPriceCategory?: boolean;
|
|
21
|
-
vehicleComponentName?: 'comparable' | 'landing' | 'search' | 'main' | 'myVehicles';
|
|
23
|
+
vehicleComponentName?: 'comparable' | 'landing' | 'search' | 'main' | 'myVehicles' | 'favorite';
|
|
22
24
|
monthlyInstallment?: number;
|
|
23
25
|
oldMonthlyInstallment?: number;
|
|
24
26
|
positionY?: string;
|
|
@@ -27,12 +29,16 @@ export interface IVehiclePriceSectionProps {
|
|
|
27
29
|
mainImageId?: string;
|
|
28
30
|
toRound?: boolean;
|
|
29
31
|
showOfferBtn?: boolean;
|
|
32
|
+
margin?: number;
|
|
30
33
|
leasing?: ILeasing;
|
|
31
34
|
financing?: IFinancing;
|
|
32
35
|
buy?: IBuy;
|
|
33
36
|
common: ICommonFinancing;
|
|
34
37
|
vatRate?: number;
|
|
35
38
|
onDetailsClick(id: string): void;
|
|
39
|
+
toggleCarToCompare?(carId: string): void;
|
|
40
|
+
onRemoveClick?(carId: string): void;
|
|
41
|
+
toCompare?: boolean;
|
|
36
42
|
onAddOfferToMainSlideClick?: (id: string, mainImageId: string, price: number, financingConfig: any) => void;
|
|
37
43
|
combineRefAlternative?: boolean;
|
|
38
44
|
typeAlternative?: string;
|
|
@@ -82,6 +88,9 @@ class VehiclePrice extends React.Component<IVehiclePriceSectionProps> {
|
|
|
82
88
|
linkTag,
|
|
83
89
|
showOfferBtn,
|
|
84
90
|
routeObj,
|
|
91
|
+
toggleCarToCompare,
|
|
92
|
+
toCompare,
|
|
93
|
+
onRemoveClick,
|
|
85
94
|
vatRate,
|
|
86
95
|
iconName,
|
|
87
96
|
vehicleComponentName,
|
|
@@ -102,12 +111,13 @@ class VehiclePrice extends React.Component<IVehiclePriceSectionProps> {
|
|
|
102
111
|
|
|
103
112
|
const vehiclePriceSectionClassName = classnames(
|
|
104
113
|
styles.vehiclePriceSection,
|
|
105
|
-
{ [styles.vehiclePriceSectionSearch]: vehicleComponentName === 'search' || vehicleComponentName === 'myVehicles' }
|
|
114
|
+
{ [styles.vehiclePriceSectionSearch]: vehicleComponentName === 'search' || vehicleComponentName === 'myVehicles' },
|
|
115
|
+
{ [styles.vehiclePriceSectionFavorite]: vehicleComponentName === 'favorite' }
|
|
106
116
|
);
|
|
107
117
|
|
|
108
118
|
const vehiclePriceTitleClassName = classnames(
|
|
109
119
|
styles.vehiclePriceTitle,
|
|
110
|
-
{ [styles.vehiclePriceTitleSearch]: vehicleComponentName === 'search' ||
|
|
120
|
+
{ [styles.vehiclePriceTitleSearch]: vehicleComponentName === 'search' || 'myVehicles' || 'favorite' }
|
|
111
121
|
);
|
|
112
122
|
const priceItemsGlobal = [
|
|
113
123
|
{
|
|
@@ -128,6 +138,19 @@ class VehiclePrice extends React.Component<IVehiclePriceSectionProps> {
|
|
|
128
138
|
}
|
|
129
139
|
];
|
|
130
140
|
|
|
141
|
+
const Abo = vehicleComponentName !== 'favorite' ? [
|
|
142
|
+
{
|
|
143
|
+
perMonthOld: oldMonthlyInstallment,
|
|
144
|
+
perMonthCurrent: monthlyInstallment,
|
|
145
|
+
isNewPriceCategory: true,
|
|
146
|
+
showAboIcon: true,
|
|
147
|
+
isPriceDisable: true,
|
|
148
|
+
positionY: 'top',
|
|
149
|
+
title: t('vehicleProps:title.abo'),
|
|
150
|
+
tooltipDescription: t('vehicleProps:title.aboDescription')
|
|
151
|
+
}
|
|
152
|
+
] : '';
|
|
153
|
+
|
|
131
154
|
const priceData: IPriceData[] = combineRefAlternative ? [
|
|
132
155
|
...priceItemsGlobal,
|
|
133
156
|
{
|
|
@@ -144,16 +167,7 @@ class VehiclePrice extends React.Component<IVehiclePriceSectionProps> {
|
|
|
144
167
|
}
|
|
145
168
|
] : [
|
|
146
169
|
...priceItemsGlobal,
|
|
147
|
-
|
|
148
|
-
perMonthOld: oldMonthlyInstallment,
|
|
149
|
-
perMonthCurrent: monthlyInstallment,
|
|
150
|
-
isNewPriceCategory: true,
|
|
151
|
-
showAboIcon: true,
|
|
152
|
-
isPriceDisable: true,
|
|
153
|
-
positionY: 'top',
|
|
154
|
-
title: t('vehicleProps:title.abo'),
|
|
155
|
-
tooltipDescription: t('vehicleProps:title.aboDescription')
|
|
156
|
-
},
|
|
170
|
+
...Abo,
|
|
157
171
|
{
|
|
158
172
|
isTotal: true,
|
|
159
173
|
totalCurrent: currentSalesPriceExtra,
|
|
@@ -211,8 +225,26 @@ class VehiclePrice extends React.Component<IVehiclePriceSectionProps> {
|
|
|
211
225
|
);
|
|
212
226
|
return (
|
|
213
227
|
<section className={vehiclePriceSectionClassName}>
|
|
214
|
-
|
|
228
|
+
{vehicleComponentName === 'favorite' ? (
|
|
229
|
+
<Checkbox
|
|
230
|
+
checked={toCompare}
|
|
231
|
+
onChange={toggleCarToCompare}
|
|
232
|
+
label={t('FavoritesPage:toCompare')}
|
|
233
|
+
labelClassName={styles.wrapCheckbox}
|
|
234
|
+
/>
|
|
235
|
+
) : <span className={vehiclePriceTitleClassName}>{t('vehicleProps:title.monthlyFrom')}</span>}
|
|
215
236
|
{ListPrices}
|
|
237
|
+
{vehicleComponentName === 'favorite' && (
|
|
238
|
+
<div className={styles.wrapHandleCompare}>
|
|
239
|
+
<Button variant='text' onClick={onRemoveClick} className={styles.btnCompareRemove} color='secondary'>
|
|
240
|
+
<IconSVG className={styles.removeIcon} name='trashIcon' customDimensions />
|
|
241
|
+
</Button>
|
|
242
|
+
<Button className={styles.btnCarToCompare} variant='outlined' onClick={toggleCarToCompare}>
|
|
243
|
+
<span className={styles.btnPlusIcon}>{!toCompare ? '+' : '-'}</span>
|
|
244
|
+
<span className={styles.btnText}>{t('FavoritesPage:compare')}</span>
|
|
245
|
+
</Button>
|
|
246
|
+
</div>
|
|
247
|
+
)}
|
|
216
248
|
{isDealerSuperAdmin && !typeAlternative ? (
|
|
217
249
|
<Button className={styles.addOfferButton} onClick={this.onAddOfferClick}>
|
|
218
250
|
{t('vehicleProps:title.addOfferToMainSlide')}
|
|
@@ -24,17 +24,17 @@ const VehicleTitle: React.FC<IVehicleTitleProps> = ({
|
|
|
24
24
|
|
|
25
25
|
const infoSectionClassName = classnames(
|
|
26
26
|
styles.infoSection,
|
|
27
|
-
{ [styles.infoSectionSearch]: vehicleComponentName === 'search' },
|
|
27
|
+
{ [styles.infoSectionSearch]: vehicleComponentName === 'search' || 'favorite' },
|
|
28
28
|
{ [styles.infoSectionMyVehicles]: vehicleComponentName === 'myVehicles' }
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
const wrapTitlesClassName = classnames(
|
|
32
32
|
styles.wrapTitles,
|
|
33
|
-
{ [styles.wrapTitlesSearch]: vehicleComponentName === 'search' || 'myVehicles'
|
|
33
|
+
{ [styles.wrapTitlesSearch]: vehicleComponentName === 'search' || 'myVehicles' || 'favorite' }
|
|
34
34
|
);
|
|
35
35
|
const optionTitleClassName = classnames(
|
|
36
36
|
styles.optionTitle,
|
|
37
|
-
{ [styles.optionTitleSearch]: vehicleComponentName === 'search' || 'myVehicles' },
|
|
37
|
+
{ [styles.optionTitleSearch]: vehicleComponentName === 'search' || 'myVehicles' || 'favorite' },
|
|
38
38
|
{ [styles.optionTitleIsAlternative]: combineRefAlternative }
|
|
39
39
|
);
|
|
40
40
|
|
|
@@ -72,6 +72,27 @@
|
|
|
72
72
|
'title title price'\
|
|
73
73
|
'image info price'
|
|
74
74
|
|
|
75
|
+
&.vehicleWrapFavorite
|
|
76
|
+
grid-template-areas:
|
|
77
|
+
'title title'\
|
|
78
|
+
'image image'\
|
|
79
|
+
'info price'\
|
|
80
|
+
'seoText seoText'
|
|
81
|
+
grid-template-columns: 155px 1fr;
|
|
82
|
+
border: 1px solid $grey-e;
|
|
83
|
+
border-radius: 10px;
|
|
84
|
+
// border-bottom: 6px solid $skyBlue;
|
|
85
|
+
margin: 10px;
|
|
86
|
+
padding-bottom: 15px;
|
|
87
|
+
+media-tablet-landscape-up()
|
|
88
|
+
border: 1px solid $grey-e;
|
|
89
|
+
padding: 10px;
|
|
90
|
+
grid-gap: 10px 15px;
|
|
91
|
+
grid-template-columns: 260px 1fr 245px;
|
|
92
|
+
grid-template-areas:
|
|
93
|
+
'title title price'\
|
|
94
|
+
'image info price'
|
|
95
|
+
|
|
75
96
|
&.vehicleWrapMyVeicles
|
|
76
97
|
grid-template-areas:
|
|
77
98
|
'title title'\
|
|
@@ -18,7 +18,8 @@ import {
|
|
|
18
18
|
IVehicleLocation,
|
|
19
19
|
IVehicleTitleProps,
|
|
20
20
|
IVehicleSliderProps,
|
|
21
|
-
IVehicleSliderForSRLProps
|
|
21
|
+
IVehicleSliderForSRLProps,
|
|
22
|
+
IVehicleCompareProps
|
|
22
23
|
} from '../../framework/types/types';
|
|
23
24
|
import { vehicleProps } from '../../locales/data';
|
|
24
25
|
import styles from './VehicleSmallCard.styl';
|
|
@@ -31,7 +32,7 @@ interface IVehicleSmallCardProps {
|
|
|
31
32
|
t?: (key: string, options?: object) => string;
|
|
32
33
|
i18nPrefixForPriceRating?: string;
|
|
33
34
|
language?: string;
|
|
34
|
-
vehicleComponentName?: 'comparable' | 'landing' | 'search' | 'main' | 'myVehicles';
|
|
35
|
+
vehicleComponentName?: 'comparable' | 'landing' | 'search' | 'main' | 'myVehicles' | 'favorite';
|
|
35
36
|
isTop?: boolean;
|
|
36
37
|
isDealer?: boolean;
|
|
37
38
|
isDealerSuperAdmin?: boolean;
|
|
@@ -44,6 +45,7 @@ interface IVehicleSmallCardProps {
|
|
|
44
45
|
title?: IVehicleTitleProps;
|
|
45
46
|
info?: IVehicleInfo;
|
|
46
47
|
location?: IVehicleLocation;
|
|
48
|
+
compareProps?: IVehicleCompareProps;
|
|
47
49
|
environmentEmissions?: object;
|
|
48
50
|
consumption?: object;
|
|
49
51
|
engineData?: object;
|
|
@@ -90,6 +92,7 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
|
|
|
90
92
|
i18nPrefixForPriceRating,
|
|
91
93
|
stats,
|
|
92
94
|
statsData,
|
|
95
|
+
compareProps,
|
|
93
96
|
title,
|
|
94
97
|
info,
|
|
95
98
|
location,
|
|
@@ -150,6 +153,7 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
|
|
|
150
153
|
{ [styles.vehicleWrapSearch]: vehicleComponentName === 'search' },
|
|
151
154
|
{ [styles.vehicleWrapComparable]: vehicleComponentName === 'comparable' },
|
|
152
155
|
{ [styles.vehicleWrapMyVeicles]: vehicleComponentName === 'myVehicles' },
|
|
156
|
+
{ [styles.vehicleWrapFavorite]: vehicleComponentName === 'favorite' },
|
|
153
157
|
{ [styles.topVehicle]: isTop },
|
|
154
158
|
{ [styles.disableBorder]: minimizeData },
|
|
155
159
|
{ [styles.isFirstReferenceCar]: isReferenceSearch && index === 0 && currentPage === 1 },
|
|
@@ -217,7 +221,8 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
|
|
|
217
221
|
combineRefAlternative,
|
|
218
222
|
typeAlternative,
|
|
219
223
|
isAlternative,
|
|
220
|
-
...price
|
|
224
|
+
...price,
|
|
225
|
+
...compareProps
|
|
221
226
|
};
|
|
222
227
|
|
|
223
228
|
const lazyLoadProps = {
|
|
@@ -258,7 +263,7 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
|
|
|
258
263
|
<>
|
|
259
264
|
{showSlider ? (
|
|
260
265
|
<>
|
|
261
|
-
{vehicleComponentName === 'search' || vehicleComponentName === 'myVehicles' ? (
|
|
266
|
+
{vehicleComponentName === 'search' || vehicleComponentName === 'myVehicles' || vehicleComponentName === 'favorite' ? (
|
|
262
267
|
<>
|
|
263
268
|
<DecoratedSliderForSRL {...decoratedSliderProps} />
|
|
264
269
|
{renderIDInfo && isDealer ? renderIDInfo() : null}
|
|
@@ -347,6 +352,7 @@ export default memo(VehicleSmallCard, (props, nextProps) => { // shouldComponent
|
|
|
347
352
|
leasing: { monthlyInstallment: lMonthlyInstallment }
|
|
348
353
|
},
|
|
349
354
|
isCarInFavorite,
|
|
355
|
+
compareProps,
|
|
350
356
|
children
|
|
351
357
|
} = props;
|
|
352
358
|
|
|
@@ -356,5 +362,6 @@ export default memo(VehicleSmallCard, (props, nextProps) => { // shouldComponent
|
|
|
356
362
|
&& withFinalInstallment === nextProps.price.financing.withFinalInstallment
|
|
357
363
|
&& lMonthlyInstallment === nextProps.price.leasing.monthlyInstallment
|
|
358
364
|
&& isCarInFavorite === nextProps.isCarInFavorite
|
|
365
|
+
&& _get(compareProps, 'toCompare') === _get(compareProps, 'nextProps.toCompare')
|
|
359
366
|
&& children === nextProps.children;
|
|
360
367
|
});
|
|
@@ -13,7 +13,7 @@ export interface ICheckboxProps {
|
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
reversed?: boolean;
|
|
15
15
|
isAboAccordionExpanded0?: boolean;
|
|
16
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked
|
|
16
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked?: boolean, value?: any) => void;
|
|
17
17
|
onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;
|
|
18
18
|
onFocus?: (event: React.FocusEvent<HTMLDivElement>) => void;
|
|
19
19
|
|
|
@@ -89,7 +89,7 @@ export interface IVehicleInfo {
|
|
|
89
89
|
i18nPrefixForPriceRating?: string;
|
|
90
90
|
gearbox?: string;
|
|
91
91
|
regDate?: number;
|
|
92
|
-
vehicleComponentName?: 'comparable' | 'landing' | 'search' | 'main' | 'myVehicles';
|
|
92
|
+
vehicleComponentName?: 'comparable' | 'landing' | 'search' | 'main' | 'myVehicles' | 'favorite';
|
|
93
93
|
language?: string;
|
|
94
94
|
combineRefAlternative?: boolean;
|
|
95
95
|
routeObj?: any;
|
|
@@ -102,6 +102,11 @@ export interface IVehicleInfo {
|
|
|
102
102
|
engineData?: any;
|
|
103
103
|
offer?: any;
|
|
104
104
|
consumption?: any;
|
|
105
|
+
numberOfPreviousOwners?: any;
|
|
106
|
+
usageType?: any;
|
|
107
|
+
condition?: any;
|
|
108
|
+
damaged?: any;
|
|
109
|
+
driveType?: any;
|
|
105
110
|
url?: string;
|
|
106
111
|
}
|
|
107
112
|
|
|
@@ -110,7 +115,7 @@ export interface IVehicleTitleProps {
|
|
|
110
115
|
model?: string;
|
|
111
116
|
subModel?: string;
|
|
112
117
|
option?: string;
|
|
113
|
-
vehicleComponentName?: 'comparable' | 'landing' | 'search' | 'main' | 'myVehicles';
|
|
118
|
+
vehicleComponentName?: 'comparable' | 'landing' | 'search' | 'main' | 'myVehicles' | 'favorite';
|
|
114
119
|
isSponsored?: boolean;
|
|
115
120
|
showFavoriteStar?: boolean;
|
|
116
121
|
id?: string;
|
|
@@ -321,3 +326,9 @@ export interface IPanelConfigProps {
|
|
|
321
326
|
isAlternative?: boolean;
|
|
322
327
|
onToggleDetailsClick: () => void;
|
|
323
328
|
}
|
|
329
|
+
|
|
330
|
+
export interface IVehicleCompareProps {
|
|
331
|
+
toggleCarToCompare: () => void;
|
|
332
|
+
toCompare: boolean;
|
|
333
|
+
onRemoveClick: () => void;
|
|
334
|
+
}
|
|
@@ -38,7 +38,16 @@ const getDecoratedLightProps = (
|
|
|
38
38
|
simplifiedLabels: boolean = false // shortened labels for repsonsive layout (see 'power')
|
|
39
39
|
): IDecoratedProps => {
|
|
40
40
|
const {
|
|
41
|
-
mainData: {
|
|
41
|
+
mainData: {
|
|
42
|
+
offer = {},
|
|
43
|
+
mileage,
|
|
44
|
+
firstRegistration,
|
|
45
|
+
location,
|
|
46
|
+
numberOfPreviousOwners = '',
|
|
47
|
+
usageType = '',
|
|
48
|
+
condition = '',
|
|
49
|
+
damaged = ''
|
|
50
|
+
}
|
|
42
51
|
} = car;
|
|
43
52
|
return {
|
|
44
53
|
mileage: {
|
|
@@ -242,6 +251,40 @@ const getDecoratedLightProps = (
|
|
|
242
251
|
return isPropDefined(gearbox) ? t(`cbd:${gearbox}`) : 'N/A';
|
|
243
252
|
}
|
|
244
253
|
},
|
|
254
|
+
numberOfPreviousOwners: {
|
|
255
|
+
title: t('vehicleProps:title.numberOfPreviousOwners'),
|
|
256
|
+
icon: 'owner',
|
|
257
|
+
get value() {
|
|
258
|
+
return Number.isFinite(numberOfPreviousOwners)
|
|
259
|
+
? t('vehicleProps:value.vehicleOwners', { count: numberOfPreviousOwners })
|
|
260
|
+
: t('vehicleProps:value.na');
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
usageType: {
|
|
264
|
+
icon: 'new',
|
|
265
|
+
get value() {
|
|
266
|
+
if (condition === 'selector_condition_new') return t('vehicleProps:value.newCar');
|
|
267
|
+
return isPropDefined(usageType) ? t(`cbd:${usageType}`) : t('cbd:selector_condition_used');
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
driveType: {
|
|
271
|
+
title: t('vehicleProps:title.driveType'),
|
|
272
|
+
get icon() {
|
|
273
|
+
const driveType = car.driveSuspension.driveType;
|
|
274
|
+
return isPropDefined(driveType) ? car.driveSuspension.driveType : 'selector_driveType_frontWheelDrive';
|
|
275
|
+
},
|
|
276
|
+
get value() {
|
|
277
|
+
const driveType = car.driveSuspension.driveType;
|
|
278
|
+
return isPropDefined(driveType) ? t(`cbd:${driveType}`) : t('vehicleProps:value.na');
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
accidentDamaged: {
|
|
282
|
+
title: t('cbd:mainData_accidentDamaged'),
|
|
283
|
+
icon: 'wrench',
|
|
284
|
+
get value() {
|
|
285
|
+
return damaged ? t('vehicleProps:value.damaged') : t('vehicleProps:value.accidentFree');
|
|
286
|
+
}
|
|
287
|
+
},
|
|
245
288
|
fuel: {
|
|
246
289
|
name: 'fuel',
|
|
247
290
|
title: 'Kraftstoffe',
|
|
@@ -34,6 +34,7 @@ const comparableList = ['firstRegistration', 'mileage', 'gearbox'];
|
|
|
34
34
|
const landingList = ['mileage', 'gearbox', 'fuel'];
|
|
35
35
|
const location = ['location'];
|
|
36
36
|
const searchResultList = ['mileage', 'firstRegistration', 'gearbox', 'fuel', 'power'];
|
|
37
|
+
const searchFavoriteList = ['mileage', 'firstRegistration', 'numberOfPreviousOwners', 'gearbox', 'usageType', 'fuel', 'power', 'driveType'];
|
|
37
38
|
const consumptionCombinedAlternateView = ['consumptionCombinedAlternateView'];
|
|
38
39
|
const consumptionPowerCombinedAlternateView = ['consumptionPowerCombinedAlternateView'];
|
|
39
40
|
const consumptionCombinedHybridAlternateView = ['consumptionCombinedHybridAlternateView'];
|
|
@@ -307,3 +308,23 @@ export const getMainPropertiesForSRL = (selector: any, isAlternative?: boolean)
|
|
|
307
308
|
return mainArraySRL;
|
|
308
309
|
}, []); //tslint:disable-line
|
|
309
310
|
};
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
export const getMainPropertiesForFavorite = (selector: any, isAlternative?: boolean) => {
|
|
314
|
+
if (Object.keys(filtered(selector)).length === 0) {
|
|
315
|
+
|
|
316
|
+
const mainArrayFavorite = [...searchFavoriteList, ...consumptionCombinedAlternateView, ...offerAvailability, 'accidentDamaged'];
|
|
317
|
+
if (isAlternative) {
|
|
318
|
+
mainArrayFavorite.unshift(...location);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
return mainArrayFavorite;
|
|
322
|
+
}
|
|
323
|
+
return filtered(selector).reduce((_selector, item) => {
|
|
324
|
+
const mainArrayFavorite = [...searchFavoriteList, ...item.consumptionCombined, ...offerAvailability, 'accidentDamaged'];
|
|
325
|
+
if (isAlternative) {
|
|
326
|
+
mainArrayFavorite.unshift(...location);
|
|
327
|
+
}
|
|
328
|
+
return mainArrayFavorite;
|
|
329
|
+
}, []); //tslint:disable-line
|
|
330
|
+
};
|