@bytebrand/fe-ui-core 4.1.39 → 4.1.40

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core",
3
- "version": "4.1.39",
3
+ "version": "4.1.40",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -22,9 +22,6 @@
22
22
  &.priceItemCategorySearch
23
23
  +media-tablet-landscape-up()
24
24
  font-size: 12px;
25
- &:last-of-type
26
- border-top: 1px solid $grey-d3
27
- padding-top: 12px;
28
25
  &:nth-of-type(3), &:last-of-type
29
26
  .tooltipWrap
30
27
  &__block
@@ -37,6 +34,9 @@
37
34
  &::after
38
35
  transform: rotate(180deg) translateX(3px);
39
36
 
37
+ .priceItemBuy
38
+ border-top: 1px solid $grey-d3
39
+
40
40
  .priceItemCategory
41
41
  font-size: 12px
42
42
  font-weight bold
@@ -59,6 +59,11 @@
59
59
  +media-tablet-landscape-up()
60
60
  font-size: 12px;
61
61
 
62
+ &.priceItemCategoryFavorite
63
+ +media-tablet-landscape-up()
64
+ font-size: 13px !important;
65
+ color: rgba(76, 78, 100, 0.87);
66
+
62
67
  .priceItemDisable
63
68
  pointer-events: none;
64
69
  .priceItemCategory
@@ -131,4 +136,8 @@
131
136
  .isAlternativeText
132
137
  position: absolute;
133
138
  font-size: 8px;
134
- bottom: 5px;
139
+ bottom: 5px;
140
+
141
+ .tooltipWrapFavorites
142
+ transform: translateY(-1px);
143
+ margin-left: 5px;
@@ -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,14 @@ class VehiclePriceItem extends React.Component<IVehiclePriceItemProps> {
66
66
 
67
67
  const stylesItem = classnames(
68
68
  styles.priceItem,
69
- { [styles.priceItemDisable]: isPriceDisable }
69
+ { [styles.priceItemDisable]: isPriceDisable },
70
+ { [styles.priceItemBuy]: isTotal },
70
71
  );
71
72
 
72
73
  const priceItemCategoryClassName = classnames(
73
74
  styles.priceItemCategory,
74
- { [styles.priceItemCategorySearch]: vehicleComponentName === 'search' || vehicleComponentName === 'myVehicles' }
75
+ { [styles.priceItemCategorySearch]: vehicleComponentName === 'search' || vehicleComponentName === 'myVehicles' },
76
+ { [styles.priceItemCategoryFavorite]: vehicleComponentName === 'favorite' }
75
77
  );
76
78
  return (
77
79
  <div className={stylesItem}>
@@ -82,7 +84,15 @@ class VehiclePriceItem extends React.Component<IVehiclePriceItemProps> {
82
84
  className: priceItemCategoryClassName,
83
85
  href: url
84
86
  })}
85
- {tooltipDescription && <Tooltip description={tooltipDescription} positionX={positionX} positionY={positionY} iconName={iconName} />}
87
+ {tooltipDescription && (
88
+ <Tooltip
89
+ tooltipClassName={vehicleComponentName === 'favorite' ? styles.tooltipWrapFavorites : ''}
90
+ description={tooltipDescription}
91
+ positionX={positionX}
92
+ positionY={positionY}
93
+ iconName={vehicleComponentName === 'favorite' ? 'infoIcon' : iconName}
94
+ />
95
+ )}
86
96
  {isNewPriceCategory && (
87
97
  <span className={styles.priceNewBlock}>neu</span>
88
98
  )}
@@ -152,6 +152,65 @@
152
152
  height: 16px;
153
153
  max-width: 25%;
154
154
 
155
+ &.vehiclePropertiesFavorite
156
+ grid-template-columns: 1fr 1fr;
157
+ display: grid;
158
+ grid-auto-rows: 44px;
159
+
160
+ & > .consumptionCombined
161
+ white-space: pre-line;
162
+ grid-column: 1 / span 2;
163
+ grid-row: 4;
164
+
165
+ & > .location
166
+ grid-column: 1 / span 2;
167
+
168
+ +media-tablet-landscape-up()
169
+ height: 30px;
170
+ margin-top: auto;
171
+ border: none;
172
+
173
+ & > div:last-of-type
174
+ grid-column: 1 / span 2;
175
+
176
+ &::after
177
+ height: calc(100% - 20px);
178
+
179
+ +media-tablet-landscape-up()
180
+ grid-template-columns: 1fr 1fr 1fr;
181
+ margin-top: -13px;
182
+ padding: 0;
183
+ grid-auto-rows: 52px;
184
+
185
+ &:after
186
+ display none
187
+
188
+ & > .consumptionCombined,
189
+ & > div:last-of-type
190
+ grid-column: auto;
191
+ grid-row: auto;
192
+
193
+ & > .offerAvailability
194
+ border: none;
195
+ & + div
196
+ border: none;
197
+
198
+ & .carIconSearch
199
+ width: 23px;
200
+ height: 23px;
201
+ max-width: 23px;
202
+
203
+ & .priceRatingLabelSRL
204
+ font-size: 10px;
205
+
206
+ & .priceRatingSRL
207
+ margin: auto;
208
+
209
+ & .priceRatingSegmentWrapSRL > div
210
+ width: 24px
211
+ height: 16px;
212
+ max-width: 25%;
213
+
155
214
  &.vehiclePropertiesMyVehicles
156
215
  &::after
157
216
  +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' || vehicleComponentName === 'myVehicles') && styles.carIconSearch
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(getMainPropertiesForSRL, vehicleComponentName)}
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' || vehicleComponentName === 'myVehicles' ? styles.priceRatingSRL : ''}`}
111
- classLabel={vehicleComponentName === 'search' || vehicleComponentName === 'myVehicles' ? styles.priceRatingLabelSRL : ''}
112
- classSegmentWrapper={vehicleComponentName === 'search' || vehicleComponentName === 'myVehicles' ? styles.priceRatingSegmentWrapSRL : ''}
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,13 @@
18
18
  padding: 0 5px 0 15px;
19
19
  border-left: 1px solid $grey-d
20
20
 
21
+ &.vehiclePriceSectionFavorite
22
+ +media-tablet-landscape-up()
23
+ flex-shrink: 0;
24
+ padding: 0 5px 0 15px;
25
+ border-left: 1px solid $grey-d
26
+ gap: 3px;
27
+
21
28
  .vehiclePriceTitle
22
29
  color: $grey-3
23
30
  display block;
@@ -49,4 +56,38 @@
49
56
  text-transform: uppercase !important
50
57
 
51
58
  .isAlternativeButton
52
- background-color: $alternative !important
59
+ background-color: $alternative !important
60
+
61
+ .wrapCheckbox
62
+ height: 42px;
63
+ & > div
64
+ order: 1;
65
+ & span
66
+ margin: 0 !important;
67
+ color: rgba(76, 78, 100, 0.87);
68
+
69
+ .wrapHandleCompare
70
+ display: flex;
71
+ gap: 8px;
72
+ margin-top: 20px;
73
+
74
+ .btnCompareRemove
75
+ min-width: 50px !important;
76
+ height: 34px;
77
+ border: 1px solid #BA1A1A !important;
78
+
79
+ .btnCarToCompare
80
+ display: flex;
81
+ height: 34px;
82
+ align-items: center;
83
+ text-transform uppercase !important
84
+ width: 100%;
85
+
86
+ .btnPlusIcon
87
+ font-size: 26px;
88
+ margin-right: 10px;
89
+ line-height: 32px;
90
+
91
+ .btnText
92
+ position: relative;
93
+ 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' || vehicleComponentName === 'myVehicles' }
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
- <span className={vehiclePriceTitleClassName}>{t('vehicleProps:title.monthlyFrom')}</span>
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:toCompare')}</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,23 @@
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: 50% 50%;
82
+ border-bottom: 6px solid $skyBlue;
83
+ +media-tablet-landscape-up()
84
+ border: 1px solid $grey-e;
85
+ padding: 10px;
86
+ grid-gap: 10px 15px;
87
+ grid-template-columns: 260px 1fr 245px;
88
+ grid-template-areas:
89
+ 'title title price'\
90
+ 'image info price'
91
+
75
92
  &.vehicleWrapMyVeicles
76
93
  grid-template-areas:
77
94
  '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: boolean, value: any) => void;
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: { offer = {}, mileage, firstRegistration, location }
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
+ };