@bytebrand/fe-ui-core 4.2.251 → 4.3.1

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.
Files changed (125) hide show
  1. package/__tests__/utils/CommonUtils/getOfferSliders.test.ts +2 -4
  2. package/common.ts +2 -6
  3. package/package.json +2 -3
  4. package/source/components/AccordionWidget/AccordionWidget.tsx +3 -1
  5. package/source/components/Breadcrumbs/Breadcrumbs.tsx +3 -3
  6. package/source/components/Checkout/CheckoutStepper/CheckoutStepper.styl +190 -2
  7. package/source/components/Checkout/CheckoutStepper/CheckoutStepper.tsx +16 -15
  8. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.styl +2 -2
  9. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.tsx +3 -3
  10. package/source/components/FormattedNumber/FormattedNumber.tsx +3 -2
  11. package/source/components/InfoBlocks/FirstInfoBlock/FirstInfoBlockItem/FirstInfoBlockItem.styl +6 -4
  12. package/source/components/OfferDetailedSection/partials/PanelConfig.tsx +3 -0
  13. package/source/components/OfferPanel/MuiOfferPeriod/{MuiOfferPeriod.theme.tsx → MuiOfferPeriod.theme.js} +13 -8
  14. package/source/components/OfferPanel/MuiOfferPeriod/MuiOfferPeriod.tsx +4 -28
  15. package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +12 -6
  16. package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +1 -1
  17. package/source/components/OfferPanel/OfferPanel.tsx +1 -1
  18. package/source/components/OfferPanel/OfferPeriod/OfferPeriod.tsx +4 -0
  19. package/source/components/OfferPanel/RangeGroup/RangeGroup.tsx +4 -6
  20. package/source/components/PriceRatingDetailed/PriceRatingDetailed.tsx +2 -6
  21. package/source/components/SearchFilters/filters/AlternativeID.tsx +53 -42
  22. package/source/components/SearchFilters/filters/DriveType.tsx +1 -1
  23. package/source/components/SearchFilters/filters/EmissionSticker.tsx +1 -1
  24. package/source/components/SearchFilters/filters/FirstRegistration.tsx +1 -0
  25. package/source/components/SearchFilters/filters/InteriorColor.tsx +1 -1
  26. package/source/components/SearchFilters/filters/InteriorMaterial.tsx +1 -2
  27. package/source/components/SearchFilters/filters/Mileage.tsx +1 -1
  28. package/source/components/SearchFilters/filters/Power.tsx +17 -36
  29. package/source/components/SearchFilters/filters/StateOptions.tsx +1 -0
  30. package/source/components/SearchFilters/filters/Transmission.tsx +1 -1
  31. package/source/components/SearchPage/SearchChips/SearchChips.tsx +1 -1
  32. package/source/components/SearchPageMobile/FiltersDetailed/BodyType.tsx +3 -3
  33. package/source/components/SearchPageMobile/FiltersDetailed/Consumption.tsx +2 -2
  34. package/source/components/SearchPageMobile/FiltersDetailed/Doors.tsx +1 -1
  35. package/source/components/SearchPageMobile/FiltersDetailed/MakeModel.tsx +1 -1
  36. package/source/components/SearchWidget/ColorWidget/BodyColorWidget.tsx +3 -3
  37. package/source/components/SearchWidget/EnvironmentWidget/EnvironmentWidget.tsx +3 -3
  38. package/source/components/SearchWidget/HighlightsWidget/HighlightsWidget.tsx +2 -2
  39. package/source/components/SearchWidget/StateWidget/StateWidget.tsx +2 -1
  40. package/source/components/SearchWidgetsMobile/BasicDataWidgetMobile/BasicDataWidgetMobile.tsx +4 -4
  41. package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidget.tsx +16 -16
  42. package/source/components/SearchWidgetsMobile/HighlightsWidgetMobile/HighlightsWidgetMobile.tsx +1 -1
  43. package/source/components/SearchWidgetsMobile/InteriorWidget/InteriorWidget.tsx +1 -1
  44. package/source/components/SearchWidgetsMobile/SafetyWidget/SafetyWidget.tsx +6 -6
  45. package/source/components/Stepper/Stepper.tsx +3 -4
  46. package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.styl +2 -11
  47. package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.tsx +5 -5
  48. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCar.tsx +38 -57
  49. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCard.tsx +2 -2
  50. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.tsx +101 -183
  51. package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.tsx +7 -5
  52. package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.tsx +7 -33
  53. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.styl +2 -10
  54. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +14 -54
  55. package/source/components/VehicleDetailedSidebar/partials/Price.styl +1 -5
  56. package/source/components/VehicleDetailedSidebar/partials/Price.tsx +1 -2
  57. package/source/components/VehicleDetailedSidebar/partials/PriceContent.styl +5 -16
  58. package/source/components/VehicleDetailedSidebar/partials/PriceContent.tsx +4 -9
  59. package/source/components/VehicleDetailedSidebar/partials/Properties.tsx +1 -1
  60. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.styl +0 -45
  61. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +42 -121
  62. package/source/components/VehicleDetailedSlider/partials/PriceData.styl +1 -4
  63. package/source/components/VehicleDetailedSlider/partials/PriceData.tsx +1 -8
  64. package/source/components/VehicleDetailedSlider/partials/Stats.tsx +2 -2
  65. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +7 -9
  66. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +1 -35
  67. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.tsx +3 -9
  68. package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.styl +2 -11
  69. package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +1 -2
  70. package/source/components/VehicleSmallCard/VehicleSmallCard.styl +1 -3
  71. package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +7 -3
  72. package/source/components/_common/Badge/Badge.styl +0 -3
  73. package/source/components/_common/Badge/Badge.tsx +1 -1
  74. package/source/components/_common/Button/Button.tsx +4 -5
  75. package/source/components/_common/Checkbox/FormCheckbox.tsx +4 -4
  76. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.tsx +1 -1
  77. package/source/components/_common/Chip/Chip.tsx +3 -1
  78. package/source/components/_common/ExpansionPanel/ExpansionPanel.tsx +3 -3
  79. package/source/components/_common/IconSVG/IconSVGConfig.tsx +0 -2
  80. package/source/components/_common/IconSVG/SVG/flags/SK.tsx +1 -0
  81. package/source/components/_common/IconSVG/SVG/slider/360New.tsx +1 -1
  82. package/source/components/_common/MaterialAccordion/MaterialAccordion.tsx +30 -22
  83. package/source/components/_common/MaterialAutocomplete/MaterialAutocomplete.styled.tsx +8 -8
  84. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.styled.tsx +1 -0
  85. package/source/components/_common/MaterialSelect/MaterialSelect.styled.tsx +15 -12
  86. package/source/components/_common/MaterialSelect/MaterialSelect.tsx +3 -3
  87. package/source/components/_common/MaterialSwitch/MaterialSwitch.tsx +1 -3
  88. package/source/components/_common/MaterialTooltip/MaterialTooltip.styled.tsx +1 -1
  89. package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +3 -3
  90. package/source/components/_common/Modal/CookieModal.tsx +3 -1
  91. package/source/components/_common/Modal/Modal.styled.tsx +1 -2
  92. package/source/components/_common/Modal/Modal.tsx +5 -1
  93. package/source/components/_common/Modal/ModalsConfig.tsx +1 -5
  94. package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.styl +7 -23
  95. package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.tsx +36 -84
  96. package/source/components/_common/Modal/modals/PreviewCookieModal/PreviewCookieModal.styl +14 -29
  97. package/source/components/_common/Modal/modals/PreviewCookieModal/PreviewCookieModal.tsx +10 -17
  98. package/source/components/_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper.tsx +4 -12
  99. package/source/components/_common/Range/Range.tsx +16 -26
  100. package/source/components/_common/UserMenu/MaterialMenu.styled.tsx +1 -0
  101. package/source/components/_common/UserMenu/MaterialMenu.tsx +3 -3
  102. package/source/components/_common/UserMenu/MaterialMenuItem.tsx +20 -42
  103. package/source/components/_common/UserMenu/NestedMenu.tsx +1 -1
  104. package/source/components/_common/withStats/withStats.styl +0 -3
  105. package/source/components/_common/withStats/withStats.tsx +16 -19
  106. package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.styl +1 -14
  107. package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.tsx +42 -78
  108. package/source/framework/constants/common.ts +60 -89
  109. package/source/framework/constants/highlights.ts +1 -1
  110. package/source/framework/constants.ts +1 -1
  111. package/source/framework/types/types.ts +4 -9
  112. package/source/framework/utils/CommonUtils.ts +62 -73
  113. package/source/framework/utils/DateUtils.ts +2 -10
  114. package/source/framework/vehiclesProps/decoratedLightProps.tsx +2 -1
  115. package/source/framework/vehiclesProps/decoratedProps.tsx +2 -1
  116. package/source/locales/data.ts +2 -2
  117. package/tslint.json +2 -1
  118. package/utils.ts +0 -2
  119. package/__tests__/components/UserDasboardPage/sections/CheckoutSection/CheckoutSection.test.tsx +0 -613
  120. package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx +0 -335
  121. package/source/components/UserDashboardPage/sections/CheckoutSection/CheckoutSection.styl +0 -38
  122. package/source/components/UserDashboardPage/sections/CheckoutSection/CheckoutSection.tsx +0 -120
  123. package/source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection.styl +0 -22
  124. package/source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection.tsx +0 -84
  125. package/source/components/_common/IconSVG/SVG/slider/YoutubeButton.tsx +0 -26
@@ -13,38 +13,28 @@ import withMagnifyGlassImage from '../_common/MagnifyGlass/MagnifyGlass';
13
13
  import { IImage, IPrice, SliderType } from '../../framework/types/types';
14
14
  import { PLACEHOLDER_IMAGE_SMALL_URL } from '../../framework/constants/common';
15
15
  import { VehicleDetailedSliderTranslate } from '../../locales/data';
16
- import SvgYoutubeButton from '../_common/IconSVG/SVG/slider/YoutubeButton';
17
- import Button from '../_common/Button/Button';
18
- import { updateCookieList } from '../../framework/utils/CommonUtils';
19
-
20
-
21
16
 
22
17
  import styles from './VehicleDetailedSlider.styl';
23
18
 
24
19
  interface IProps {
25
20
  t: (phrase: string, config?: any) => string;
26
21
  price: IPrice;
27
- photos: IImage[];
28
- exteriorPhotos: IImage[];
22
+ photos: IImage [];
23
+ exteriorPhotos: IImage [];
29
24
  interiorPhoto: IImage;
30
25
  mainImageUrl: string;
31
26
  mainImageBlur: boolean;
32
27
  statsData: any;
33
28
  isFavorite: boolean;
34
29
  showNewLabel: boolean;
35
- activeTab: number;
36
30
  make: string;
37
31
  model: string;
38
32
  subModel: string;
39
33
  powerKW: number;
40
34
  powerPS: number;
41
- financingConfig: any;
42
- youtubeId: string;
43
35
  showModal?: (id: string, props?: any) => void;
44
36
  hideModal: (id: string) => void;
45
37
  onCarFavorite: (event: MouseEvent<HTMLElement>) => void;
46
- showDownPayment: boolean;
47
- handleSentryInit?: () => void;
48
38
  }
49
39
 
50
40
  interface IState {
@@ -53,8 +43,6 @@ interface IState {
53
43
  smallLoaded: boolean;
54
44
  largeLoaded1: boolean;
55
45
  largeLoaded01: boolean;
56
- videoSrc: string;
57
- showYoutube: boolean;
58
46
  }
59
47
 
60
48
  const MagnifyGlassImage = withMagnifyGlassImage(Image);
@@ -71,21 +59,17 @@ class VehicleDetailedSlider extends Component<IProps, IState> {
71
59
  };
72
60
 
73
61
  private slider: any;
74
-
75
62
  private imagesCache: string[] = [];
76
63
 
77
64
  constructor(props: IProps) {
78
65
  super(props);
79
- const cookieConfig = JSON.parse(localStorage.getItem('cookieConfig')) || {};
80
- const youtubeConfig = !cookieConfig?.marketing?.includes('youtube');
66
+
81
67
  this.state = {
82
68
  activeSlide: 0,
83
69
  largeLoaded: false,
84
70
  smallLoaded: false,
85
71
  largeLoaded1: false,
86
- largeLoaded01: false,
87
- videoSrc: '',
88
- showYoutube: youtubeConfig
72
+ largeLoaded01: false
89
73
  };
90
74
  }
91
75
 
@@ -93,10 +77,8 @@ class VehicleDetailedSlider extends Component<IProps, IState> {
93
77
  this.slider.slickGoTo(0);
94
78
  };
95
79
 
96
-
97
- componentDidUpdate(prevProps: IProps, prevState: IState) {
98
- const cookieConfig = JSON.parse(localStorage.getItem('cookieConfig')) || {};
99
- const showYoutube = !cookieConfig?.marketing?.includes('youtube');
80
+ componentDidUpdate(prevProps: IProps) {
81
+ console.log('VehicleDetailedSlider-works!');
100
82
  if (prevProps.photos.length !== this.props.photos.length && this.props.photos.length === 0) {
101
83
  this.setState(() => ({
102
84
  largeLoaded: false,
@@ -105,15 +87,10 @@ class VehicleDetailedSlider extends Component<IProps, IState> {
105
87
  largeLoaded01: false
106
88
  }));
107
89
  }
108
- if (showYoutube !== prevState.showYoutube) {
109
- this.setState(() => ({
110
- showYoutube: showYoutube
111
- }));
112
- }
113
90
  }
114
91
 
115
92
  handleOpenSliderModal = (sliderType: SliderType) => {
116
- const { t = (phrase: string) => _get(VehicleDetailedSliderTranslate(statsData), phrase, phrase), photos, exteriorPhotos, interiorPhoto, showModal, hideModal, statsData, handleSentryInit } = this.props;
93
+ const { t = (phrase: string) => _get(VehicleDetailedSliderTranslate(statsData), phrase, phrase), photos, exteriorPhotos, interiorPhoto, showModal, hideModal, statsData } = this.props;
117
94
  const { activeSlide } = this.state;
118
95
 
119
96
  showModal('VEHICLE_DETAILED_SLIDER_MODAL', {
@@ -129,22 +106,12 @@ class VehicleDetailedSlider extends Component<IProps, IState> {
129
106
  onClose: (index: number) => {
130
107
  this.slider.slickGoTo(index, true);
131
108
  hideModal('VEHICLE_DETAILED_SLIDER_MODAL');
132
- },
133
- handleSentryInit: handleSentryInit
109
+ }
134
110
  });
135
111
  };
136
112
 
137
- handleSlideChange = (_currentSlide: any, nextSlide: number) => {
138
- const { photos } = this.props;
139
- if (photos[nextSlide].videoUrl) {
140
- this.setState({ videoSrc: `https://www.youtube.com/embed/${photos[nextSlide].videoUrl}` })
141
- } else {
142
- this.setState({ videoSrc: null })
143
- }
144
- }
145
-
146
113
  getImages = () => {
147
- const { photos, mainImageUrl, mainImageBlur, t, handleSentryInit } = this.props;
114
+ const { photos, mainImageUrl, mainImageBlur } = this.props;
148
115
  const { activeSlide, largeLoaded, smallLoaded, largeLoaded1, largeLoaded01 } = this.state;
149
116
 
150
117
  const imageProps = {
@@ -154,7 +121,6 @@ class VehicleDetailedSlider extends Component<IProps, IState> {
154
121
  className: styles.image,
155
122
  withLoader: false
156
123
  };
157
-
158
124
  if (Array.isArray(photos) && photos.length > 0 && largeLoaded && smallLoaded && largeLoaded1 && largeLoaded01) {
159
125
  let isMouseDown = false;
160
126
  let isDragging = false;
@@ -179,41 +145,27 @@ class VehicleDetailedSlider extends Component<IProps, IState> {
179
145
  isDragging = false;
180
146
  };
181
147
 
182
- const updateCookies = () => {
183
- const cookieConfig = localStorage.getItem('cookieConfig');
184
- const conf = JSON.parse(cookieConfig);
185
- const indexToRemove = conf.marketing.indexOf('youtube');
186
- if (indexToRemove !== -1) {
187
- conf.marketing.splice(indexToRemove, 1);
188
- }
189
- const showYoutube = !conf?.marketing?.includes('youtube');
190
- this.setState({ showYoutube: showYoutube })
191
- localStorage.setItem('cookieConfig', JSON.stringify(conf));
192
- updateCookieList(handleSentryInit);
193
- }
194
-
195
-
196
148
  const imagesCount = photos.length;
197
149
  const currentSlide = activeSlide;
198
150
  const prevSlide = (activeSlide - 1 % imagesCount + imagesCount) % imagesCount;
199
151
  const nextSlide = (activeSlide + 1 % imagesCount + imagesCount) % imagesCount;
200
- return photos.map((item: IImage, index: number) => {
152
+
153
+ return photos.map(({ imageUrlLarge, imageUrlSmall }: IImage, index: number) => {
201
154
  const showImage = index === currentSlide || index === prevSlide || index === nextSlide || this.imagesCache[index] !== undefined;
202
- const imageUrlSmall = _get(item, 'imageUrlSmall', null);
203
- const imageUrlLarge = _get(item, 'imageUrlLarge', null);
204
155
 
205
156
  this.imagesCache[currentSlide] = imageUrlLarge;
206
157
  this.imagesCache[prevSlide] = imageUrlLarge;
207
158
  this.imagesCache[nextSlide] = imageUrlLarge;
159
+
208
160
  return (
209
161
  <div
210
162
  className={styles.photo}
211
163
  key={imageUrlLarge}
212
164
  onMouseDown={handleMouseDown}
213
165
  onMouseMove={handleMouseMove}
214
- onMouseUp={this.state.showYoutube ? handleMouseUp : null}
166
+ onMouseUp={handleMouseUp}
215
167
  >
216
- {showImage && !item.videoUrl && (
168
+ {showImage && (
217
169
  <MagnifyGlassImage
218
170
  src={index !== 0 ? imageUrlLarge : null}
219
171
  srcSmall={index === 0 ? imageUrlSmall : null}
@@ -221,77 +173,54 @@ class VehicleDetailedSlider extends Component<IProps, IState> {
221
173
  {...imageProps}
222
174
  />
223
175
  )}
224
- {showImage && item.videoUrl && this.state.showYoutube && (
225
- <iframe
226
- width='100%'
227
- height='441'
228
- src={this.state.videoSrc}
229
- title='YouTube Video'
230
- className={styles.frame}
231
- ></iframe>
232
- )}
233
- {showImage && item.videoUrl && !this.state.showYoutube && this.state.videoSrc && (
234
- <div className={styles.noYoutubeWrapper}>
235
- <SvgYoutubeButton></SvgYoutubeButton>
236
- <span className={styles.youtubeCookiesText}>{t('youtube.acceptCookiesText')}</span>
237
- <div>
238
- <Button variant='text' className={styles.btn} onClick={() => window.open('https://www.youtube.com/howyoutubeworks/our-commitments/protecting-user-data/', '_blank')}>
239
- {t('youtube.dataProtection')}
240
- </Button>
241
- <Button color='primary' className={styles.btn} onClick={updateCookies}>{t('youtube.allow')}</Button>
242
- </div>
243
- </div>
244
- )}
245
176
  </div>
246
177
  );
247
178
  });
248
179
  }
180
+
249
181
  if (mainImageUrl) {
250
182
  const imagesCount = Array.isArray(photos) && photos.length > 0 ? photos.length : 0;
251
183
  const prevSlide = (activeSlide - 1 % imagesCount + imagesCount) % imagesCount;
252
184
  const nextSlide = (activeSlide + 1 % imagesCount + imagesCount) % imagesCount;
253
185
  return (
254
186
  // preload cached photos from props
255
-
256
187
  <div className={classnames(styles.photo, { [styles.blurred]: (mainImageBlur && mainImageUrl !== PLACEHOLDER_IMAGE_SMALL_URL) })} key={mainImageUrl}>
257
- {(!largeLoaded || !smallLoaded || !largeLoaded1 || !largeLoaded01) && <Image src={mainImageUrl} {...imageProps} />}
188
+ {(!largeLoaded || !smallLoaded || !largeLoaded1 || !largeLoaded01) && <Image src={mainImageUrl} {...imageProps} /> }
258
189
 
259
- {Array.isArray(photos) && photos.length > 0 && <Image
260
- style={{ display: 'none' }}
261
- src={photos[activeSlide]?.imageUrlSmall}
262
- onLoad={() => this.setState({ smallLoaded: true })}
190
+ { Array.isArray(photos) && photos.length > 0 && <Image
191
+ style={ { display: 'none' } }
192
+ src={ photos[activeSlide].imageUrlSmall }
193
+ onLoad={ () => this.setState({ smallLoaded: true }) }
263
194
  {...imageProps}
264
- />
195
+ />
265
196
  }
266
- {Array.isArray(photos) && photos.length > 0 && <Image
267
- style={{ display: 'none' }}
268
- src={photos[activeSlide]?.imageUrlLarge}
269
- onLoad={() => this.setState({ largeLoaded: true })}
197
+ { Array.isArray(photos) && photos.length > 0 && <Image
198
+ style={ { display: 'none' } }
199
+ src={ photos[activeSlide].imageUrlLarge }
200
+ onLoad={ () => this.setState({ largeLoaded: true }) }
270
201
  {...imageProps}
271
- />
202
+ />
272
203
  }
273
-
274
- {Array.isArray(photos) && photos.length > 0 && <Image
275
- style={{ display: 'none' }}
276
- src={photos[nextSlide]?.imageUrlLarge}
277
- onLoad={() => this.setState({ largeLoaded1: true })}
204
+ { Array.isArray(photos) && photos.length > 0 && <Image
205
+ style={ { display: 'none' } }
206
+ src={ photos[nextSlide].imageUrlLarge }
207
+ onLoad={ () => this.setState({ largeLoaded1: true }) }
278
208
  {...imageProps}
279
- />
209
+ />
280
210
  }
281
- {Array.isArray(photos) && photos.length > 0 && <Image
282
- style={{ display: 'none' }}
283
- src={photos[prevSlide]?.imageUrlLarge}
284
- onLoad={() => this.setState({ largeLoaded01: true })}
211
+ { Array.isArray(photos) && photos.length > 0 && <Image
212
+ style={ { display: 'none' } }
213
+ src={ photos[prevSlide].imageUrlLarge }
214
+ onLoad={ () => this.setState({ largeLoaded01: true }) }
285
215
  {...imageProps}
286
- />
216
+ />
287
217
  }
288
218
  </div>
289
219
  );
290
-
291
220
  }
292
221
 
293
222
  return (
294
- <div className={styles.noPhoto} />
223
+ <div className={styles.noPhoto}/>
295
224
  );
296
225
  };
297
226
 
@@ -307,15 +236,13 @@ class VehicleDetailedSlider extends Component<IProps, IState> {
307
236
  showNewLabel,
308
237
  make,
309
238
  model,
310
- showDownPayment,
311
239
  subModel,
312
240
  powerKW,
313
241
  powerPS,
314
- activeTab,
315
- financingConfig,
316
242
  onCarFavorite
317
243
  } = this.props;
318
244
  const { activeSlide } = this.state;
245
+
319
246
  const sliderProps = {
320
247
  autoPlay: false,
321
248
  speed: 300,
@@ -324,7 +251,6 @@ class VehicleDetailedSlider extends Component<IProps, IState> {
324
251
  arrows: Array.isArray(photos) && photos.length > 0,
325
252
  slidesToShow: 1,
326
253
  slidesToScroll: 1,
327
- beforeChange: this.handleSlideChange,
328
254
  afterChange: (index: number) => {
329
255
  this.setState({
330
256
  activeSlide: index
@@ -334,12 +260,9 @@ class VehicleDetailedSlider extends Component<IProps, IState> {
334
260
 
335
261
  const priceProps = {
336
262
  t,
337
- financingConfig,
338
263
  showNewLabel,
339
- showDownPayment,
340
264
  historyPriceDifference: price ? price.historyPriceDifference : 0,
341
- historyPriceDifferencePerCent: price ? price.historyPriceDifferencePerCent : 0,
342
- activeTab
265
+ historyPriceDifferencePerCent: price ? price.historyPriceDifferencePerCent : 0
343
266
  };
344
267
 
345
268
  const statsProps = {
@@ -357,16 +280,14 @@ class VehicleDetailedSlider extends Component<IProps, IState> {
357
280
  return (
358
281
  <div className={styles.sliderWrap}>
359
282
  {isMobileOnly &&
360
- <Title {...{ t, make, model, subModel, powerKW, powerPS, onCarFavorite, isFavorite }} />
283
+ <Title {...{ t, make, model, subModel, powerKW, powerPS, onCarFavorite, isFavorite }}/>
361
284
  }
362
285
  <div className={styles.slider}>
363
- {!photos[activeSlide]?.videoUrl && <PriceData {...priceProps} />}
286
+ <PriceData {...priceProps}/>
364
287
  <Slider ref={slider => (this.slider = slider)} {...sliderProps}>
365
288
  {this.getImages()}
366
289
  </Slider>
367
- {!photos[activeSlide]?.videoUrl ? (
368
- isMobileOnly ? <MobileStats {...statsProps} /> : <Stats {...statsProps} />
369
- ) : null}
290
+ {isMobileOnly ? <MobileStats {...statsProps} /> : <Stats {...statsProps}/>}
370
291
  </div>
371
292
  </div>
372
293
  );
@@ -24,6 +24,7 @@
24
24
  color: white
25
25
  padding: 0 15px
26
26
  float: left
27
+ text-transform: uppercase
27
28
  border-radius: 33px
28
29
  font-weight: 700;
29
30
  font-size: 20px;
@@ -45,7 +46,3 @@
45
46
  .new
46
47
  @extend .priceDifference
47
48
  margin-right: 12px
48
-
49
- .percentageOfFirstInstallment
50
- @extend .priceDifference
51
- margin-left: 12px
@@ -3,24 +3,19 @@ import FormattedNumber from '../../FormattedNumber/FormattedNumber';
3
3
  import Badge from '../../_common/Badge/Badge';
4
4
 
5
5
  import styles from './PriceData.styl';
6
- import { isNil } from 'lodash';
7
6
 
8
7
  interface IProps {
9
8
  t: (phrase: string, config?: any) => string;
10
9
  showNewLabel: boolean;
11
10
  historyPriceDifference: number;
12
11
  historyPriceDifferencePerCent: number;
13
- financingConfig?:any;
14
- activeTab?:number;
15
- showDownPayment:boolean;
16
12
  }
17
13
 
18
14
  const MIN_PERCENT = 5;
19
15
  const MIN_PRICE_DIFFERENCE = 500;
20
16
  const EUR = `\u20AC`;
21
17
 
22
- const PriceData: React.FunctionComponent<IProps> = ({ t, showDownPayment,showNewLabel, historyPriceDifference, historyPriceDifferencePerCent, financingConfig, activeTab }) => {
23
- const percentageOfFirstInstallment = activeTab === 0 ? financingConfig!.financing.percentageOfFirstInstallment : financingConfig!.leasing.percentageOfFirstInstallment;
18
+ const PriceData: React.FunctionComponent<IProps> = ({ t, showNewLabel, historyPriceDifference, historyPriceDifferencePerCent }) => {
24
19
  return (
25
20
  <div className={styles.topWrapper}>
26
21
  {showNewLabel && <Badge type='blue' className={styles.new}>{t('slider.new')}</Badge>}
@@ -30,8 +25,6 @@ const PriceData: React.FunctionComponent<IProps> = ({ t, showDownPayment,showNew
30
25
  {` ${EUR} ${t('slider.save')}`}
31
26
  </Badge>
32
27
  )}
33
- {(!isNil(percentageOfFirstInstallment) && activeTab !== 2 && showDownPayment) &&
34
- <Badge type='lightBlue' className={styles.percentageOfFirstInstallment}>{`${percentageOfFirstInstallment}${percentageOfFirstInstallment > 0 ? '%' : EUR} ${t('slider.firstInstallment')}`}</Badge>}
35
28
  {historyPriceDifferencePerCent >= MIN_PERCENT && (
36
29
  <Badge type='red' className={styles.priceDifferencePerCent}>
37
30
  -{historyPriceDifferencePerCent}%
@@ -43,7 +43,7 @@ const Stats: FunctionComponent<IProps> = (props) => {
43
43
  </div>
44
44
  )}
45
45
  </div>
46
- {(totalCarImpCount > 0 || totalFavCount > 0) && <div className={styles.statsContainer}>
46
+ <div className={styles.statsContainer}>
47
47
  {totalCarImpCount > 0 && (
48
48
  <div className={`${styles.statsBlock} ${styles.saveCarAsFavorites}`}>
49
49
  <span>{t('slider.customersLookingTheCar', { count: totalCarImpCount })}</span>
@@ -54,7 +54,7 @@ const Stats: FunctionComponent<IProps> = (props) => {
54
54
  <span>{t('slider.saveCarAsFavorites', { count: totalFavCount })}</span>
55
55
  </div>
56
56
  )}
57
- </div>}
57
+ </div>
58
58
  </div>
59
59
  );
60
60
  };
@@ -36,7 +36,6 @@ export interface IVehiclePriceItemProps {
36
36
  combineRefAlternative?: boolean;
37
37
  postfix?: string;
38
38
  margin?: number;
39
- isMarge?: boolean;
40
39
  }
41
40
  class VehiclePriceItem extends React.Component<IVehiclePriceItemProps> {
42
41
  routeToActiveTab = () => {
@@ -55,15 +54,15 @@ class VehiclePriceItem extends React.Component<IVehiclePriceItemProps> {
55
54
  totalOld,
56
55
  totalCurrent,
57
56
  tooltipDescription,
58
- // positionX,
59
- // positionY,
60
- // iconName,
57
+ positionX,
58
+ positionY,
59
+ iconName,
61
60
  postfix,
62
61
  linkTag,
63
62
  routeObj,
64
- // combineRefAlternative,
63
+ combineRefAlternative,
65
64
  prefixOldPrice,
66
- // margin,
65
+ margin,
67
66
  isAlternativeText,
68
67
  vehicleComponentName,
69
68
  priceSub,
@@ -71,8 +70,7 @@ class VehiclePriceItem extends React.Component<IVehiclePriceItemProps> {
71
70
  showAboIcon = false,
72
71
  isPriceDisable = false,
73
72
  isNewPriceCategory = false,
74
- isStrikeShown = false,
75
- isMarge
73
+ isStrikeShown = false
76
74
  } = this.props;
77
75
 
78
76
  const stylesItem = classnames(
@@ -152,7 +150,7 @@ class VehiclePriceItem extends React.Component<IVehiclePriceItemProps> {
152
150
  <span className={styles.noPrice}>---</span>
153
151
  )}
154
152
 
155
- {isStrikeShown && isTotal && !isMarge && (
153
+ {isStrikeShown && isTotal && (
156
154
  <VehicleFormattedPrice
157
155
  numbersAfterDot={0}
158
156
  className={styles.oldPrice}
@@ -127,38 +127,4 @@
127
127
  margin-right: 5px;
128
128
 
129
129
  +media-tablet-landscape-up()
130
- margin-right: 10px;
131
-
132
-
133
- .landingButton
134
- position: relative;
135
- padding: 0px 10px;
136
- background-color: transparent;
137
- border-radius: 4px;
138
- color: #005ccb;
139
- border: 1px solid #666CFF80;
140
- font-size: 16px;
141
- cursor: pointer;
142
- overflow: hidden;
143
- z-index: 0;
144
-
145
- .landingButton::before
146
- content: "";
147
- position: absolute;
148
- top: 50%;
149
- left: 50%;
150
- transform: translate(-50%, -50%);
151
- width: 30%;
152
- height: 100%;
153
- background-color: #82b1ff91;
154
- border-radius: 20%;
155
- opacity: 0;
156
- transition: width 0.7s ease-out, height 0.7s ease-out, opacity 0.7s ease-out;
157
- z-index: -1;
158
-
159
-
160
- .landingButton:active::before
161
- width: 200%;
162
- height: 200%;
163
- opacity: 1;
164
- transition: width 0.7s ease-out, height 0.7s ease-out, opacity 0.7s ease-out;
130
+ margin-right: 10px;
@@ -136,7 +136,6 @@ const VehiclePrice: React.FC<IVehiclePriceSectionProps> = (props: IVehiclePriceS
136
136
  const buttonClassNames = classnames(
137
137
  classButton,
138
138
  styles.buttonDetails,
139
- { [styles.landingButton]: vehicleComponentName === 'landing' },
140
139
  { [styles.isAlternativeButton]: typeAlternative }
141
140
  );
142
141
 
@@ -184,7 +183,7 @@ const VehiclePrice: React.FC<IVehiclePriceSectionProps> = (props: IVehiclePriceS
184
183
  }
185
184
  ] : '';
186
185
 
187
- const priceData:any = combineRefAlternative ? [
186
+ const priceData = combineRefAlternative ? [
188
187
  ...priceItemsGlobal,
189
188
  {
190
189
  isTotal: true,
@@ -196,8 +195,7 @@ const VehiclePrice: React.FC<IVehiclePriceSectionProps> = (props: IVehiclePriceS
196
195
  {
197
196
  isTotal: true,
198
197
  totalCurrent: margin ? margin : currentSalesPriceExtra,
199
- title: t('vehicleProps:title.marge'),
200
- isMarge: true
198
+ title: t('vehicleProps:title.marge')
201
199
  }
202
200
  ] : [
203
201
  ...priceItemsGlobal,
@@ -256,7 +254,6 @@ const VehiclePrice: React.FC<IVehiclePriceSectionProps> = (props: IVehiclePriceS
256
254
  routeObj={routeObj}
257
255
  vehicleComponentName={vehicleComponentName}
258
256
  combineRefAlternative={combineRefAlternative}
259
- isMarge={props.isMarge}
260
257
  />
261
258
  ))}
262
259
  {vehicleComponentName === 'favorite' && showCompareCheckboxes && (
@@ -276,10 +273,7 @@ const VehiclePrice: React.FC<IVehiclePriceSectionProps> = (props: IVehiclePriceS
276
273
  </Button>
277
274
  ) : null}
278
275
  {showOfferBtn ? (
279
- vehicleComponentName === 'landing' ? (
280
- <button className={buttonClassNames} onClick={onDetailsClick}>{t('vehicleProps:title.toOffer')}</button>
281
- ) :
282
- <Button variant={offerBtnVariantCondition} className={buttonClassNames} onClick={onDetailsClick}>{t('vehicleProps:title.toOffer')}</Button>
276
+ <Button variant={offerBtnVariantCondition} className={buttonClassNames} onClick={onDetailsClick}>{t('vehicleProps:title.toOffer')}</Button>
283
277
  ) : ''}
284
278
  </section>
285
279
  );
@@ -28,9 +28,6 @@
28
28
  display block
29
29
  +media-tablet-landscape-up()
30
30
  display flex
31
- &.wrapTitlesAlternative
32
- +media-tablet-landscape-up()
33
- flex-wrap: wrap
34
31
  &.wrapTitlesFavorite
35
32
  display: flex;
36
33
  +media-tablet-landscape-up()
@@ -60,7 +57,7 @@
60
57
 
61
58
  +media-tablet-landscape-up()
62
59
  margin: 0 0 -1px 3px
63
- overflow: hidden
60
+ max-width: 100%;
64
61
 
65
62
  .optionTitle
66
63
  display: flex
@@ -75,7 +72,6 @@
75
72
  margin-top: 3px;
76
73
  +media-tablet-landscape-up()
77
74
  margin-left: 8px;
78
- width: 100%
79
75
  margin-top: 0;
80
76
  &.optionTitleFavorite
81
77
  font-size: 12px;
@@ -87,12 +83,7 @@
87
83
  margin-left: 8px;
88
84
  &.optionTitleIsAlternative
89
85
  overflow: hidden;
90
- .subModel
91
- margin: 5px 0 0 0
92
- +media-tablet-landscape-up()
93
- max-width: 260px;
94
- +media-tablet-landscape-up()
95
- margin-left: 0
86
+ max-width: 260px;
96
87
 
97
88
  .sponsored
98
89
  font-weight: 700
@@ -33,8 +33,7 @@ const VehicleTitle: React.FC<IVehicleTitleProps> = ({
33
33
  styles.wrapTitles,
34
34
  { [styles.wrapTitlesFavorite]: vehicleComponentName === 'favorite' },
35
35
  { [styles.wrapTitlesRecently]: vehicleComponentName === 'recently' || vehicleComponentName === 'landing' || vehicleComponentName === 'main' },
36
- { [styles.wrapTitlesSearch]: vehicleComponentName === 'search' || vehicleComponentName === 'myVehicles' },
37
- { [styles.wrapTitlesAlternative]: combineRefAlternative }
36
+ { [styles.wrapTitlesSearch]: vehicleComponentName === 'search' || vehicleComponentName === 'myVehicles' }
38
37
  );
39
38
  const optionTitleClassName = classnames(
40
39
  styles.optionTitle,
@@ -224,12 +224,10 @@
224
224
 
225
225
  & > div
226
226
  display flex
227
- align-items: center;
228
- gap: 4px;
227
+ align-items: center
229
228
 
230
229
  &:first-of-type
231
230
  color: $skyBlue;
232
- line-height: 1;
233
231
 
234
232
  .isFirstReferenceCar
235
233
  border: 1px solid $skyBlue !important;
@@ -34,6 +34,7 @@ interface IVehicleSmallCardProps {
34
34
  language?: string;
35
35
  vehicleComponentName?: 'comparable' | 'landing' | 'search' | 'main' | 'myVehicles' | 'favorite' | 'recently';
36
36
  isTop?: boolean;
37
+ isDealer?: boolean;
37
38
  isDealerSuperAdmin?: boolean;
38
39
  isReferenceSearch?: boolean;
39
40
  dashboardButtonText?: string;
@@ -84,6 +85,7 @@ interface IVehicleSmallCardProps {
84
85
  isAlternative?: boolean;
85
86
  typeAlternative?: string;
86
87
  index?: number;
88
+ currentPage?: number;
87
89
  }
88
90
 
89
91
  const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
@@ -117,6 +119,7 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
117
119
  priceSubMtl,
118
120
  onContainerClick,
119
121
  onAddOfferToMainSlideClick,
122
+ isDealer,
120
123
  isDealerSuperAdmin,
121
124
  mainImageId,
122
125
  onFavoriteClick,
@@ -142,7 +145,8 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
142
145
  minimizeData = false,
143
146
  isAlternative = false,
144
147
  typeAlternative,
145
- index
148
+ index,
149
+ currentPage
146
150
  } = props;
147
151
 
148
152
  const combineRefAlternative = isAlternative || isReferenceSearch;
@@ -163,7 +167,7 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
163
167
  { [styles.vehicleWrapRecently]: vehicleComponentName === 'recently' },
164
168
  { [styles.topVehicle]: isTop },
165
169
  { [styles.disableBorder]: minimizeData },
166
- { [styles.isFirstReferenceCar]: isReferenceSearch && index === 0 },
170
+ { [styles.isFirstReferenceCar]: isReferenceSearch && index === 0 && currentPage === 1 },
167
171
  className
168
172
  );
169
173
 
@@ -291,7 +295,7 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
291
295
  {showComponentLikeSlider ? (
292
296
  <>
293
297
  <DecoratedSliderForSRL {...decoratedSliderProps} />
294
- {renderIDInfo ? renderIDInfo() : null}
298
+ {renderIDInfo && isDealer ? renderIDInfo() : null}
295
299
  {combineRefAlternative && (
296
300
  <div className={styles.wrapAlternativeData}>
297
301
  <div>
@@ -35,9 +35,6 @@ $badge-border-width = 1px
35
35
  .blue
36
36
  background-color: $primary
37
37
  color: white
38
- .lightBlue
39
- background-color: #26C6F9
40
- color: white
41
38
 
42
39
  .red
43
40
  color: #fff;