@bytebrand/fe-ui-core 4.2.241 → 4.2.243

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 (34) hide show
  1. package/package.json +1 -1
  2. package/source/components/Checkout/CheckoutStepper/CheckoutStepper.styl +2 -190
  3. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.styl +2 -2
  4. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.tsx +3 -3
  5. package/source/components/InfoBlocks/FirstInfoBlock/FirstInfoBlockItem/FirstInfoBlockItem.styl +4 -6
  6. package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.styl +5 -1
  7. package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.tsx +1 -1
  8. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCar.tsx +43 -27
  9. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.tsx +62 -27
  10. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.styl +9 -1
  11. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +36 -32
  12. package/source/components/VehicleDetailedSidebar/partials/PriceContent.tsx +1 -1
  13. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.styl +45 -0
  14. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +112 -42
  15. package/source/components/VehicleDetailedSlider/partials/Stats.tsx +2 -2
  16. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +4 -2
  17. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +35 -1
  18. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.tsx +8 -2
  19. package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.styl +11 -2
  20. package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +2 -1
  21. package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +0 -2
  22. package/source/components/_common/Button/Button.tsx +4 -2
  23. package/source/components/_common/IconSVG/IconSVGConfig.tsx +2 -0
  24. package/source/components/_common/IconSVG/SVG/slider/YoutubeButton.tsx +26 -0
  25. package/source/components/_common/MaterialAutocomplete/MaterialAutocomplete.styled.tsx +8 -8
  26. package/source/components/_common/MaterialSelect/MaterialSelect.styled.tsx +4 -4
  27. package/source/components/_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper.tsx +12 -4
  28. package/source/components/_common/withStats/withStats.styl +3 -0
  29. package/source/components/_common/withStats/withStats.tsx +18 -15
  30. package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.styl +3 -1
  31. package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.tsx +7 -7
  32. package/source/framework/types/types.ts +2 -0
  33. package/source/framework/utils/CommonUtils.ts +1 -0
  34. package/source/framework/utils/DateUtils.ts +8 -0
@@ -15,6 +15,7 @@ export interface IButtonProps {
15
15
  color?: variantColor;
16
16
  children?: any;
17
17
  variant?: variantType;
18
+ getRef?: (ref: HTMLButtonElement) => void;
18
19
 
19
20
  disabled?: boolean;
20
21
  loading?: boolean;
@@ -25,7 +26,7 @@ export interface IButtonProps {
25
26
  onMouseLeave?: (event: React.MouseEvent<HTMLButtonElement>) => void;
26
27
  }
27
28
 
28
- const Button: React.FC<IButtonProps> = ({ className, color, onClick, onMouseEnter, onMouseLeave, variant, loading, disabled, children }: IButtonProps) => {
29
+ const Button: React.FC<IButtonProps> = ({ getRef, className, color, onClick, onMouseEnter, onMouseLeave, variant, loading, disabled, children }: IButtonProps) => {
29
30
  const onHandlerClick = (event: React.MouseEvent<HTMLButtonElement>) => {
30
31
  event.stopPropagation();
31
32
  event.nativeEvent.stopImmediatePropagation();
@@ -52,6 +53,7 @@ const Button: React.FC<IButtonProps> = ({ className, color, onClick, onMouseEnte
52
53
  onClick: onHandlerClick,
53
54
  onMouseEnter: onHandlerMouseEnter,
54
55
  onMouseLeave: onHandlerMouseLeave,
56
+ ref:getRef,
55
57
  disabled: disabled || loading
56
58
  };
57
59
 
@@ -69,7 +71,7 @@ Button.defaultProps = {
69
71
  buttonType: 'button',
70
72
 
71
73
  onClick: () => { },
72
-
74
+ getRef: () => { },
73
75
  onMouseEnter: () => { },
74
76
  onMouseLeave: () => { }
75
77
  };
@@ -236,6 +236,7 @@ import Easy from './SVG/slider/Easy';
236
236
  import Safe from './SVG/slider/Safe';
237
237
  import ZoomIn from './SVG/slider/ZoomIn';
238
238
  import ZoomOut from './SVG/slider/ZoomOut';
239
+ import YoutubeButton from './SVG/slider/YoutubeButton'
239
240
 
240
241
  // social
241
242
  import SharingInterface from './SVG/social/SharingInterface';
@@ -547,6 +548,7 @@ const components: IComponentsProp = {
547
548
  safe: Safe,
548
549
  zoomIn: ZoomIn,
549
550
  zoomOut: ZoomOut,
551
+ youtubeButton:YoutubeButton,
550
552
 
551
553
  // social
552
554
  sharingInterface: SharingInterface,
@@ -0,0 +1,26 @@
1
+ /* tslint:disable */
2
+ import * as React from 'react';
3
+
4
+ const SvgYoutubeButton = (props: any) => (
5
+ <svg
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ width="146"
8
+ height="103"
9
+ viewBox="0 0 146 103"
10
+ fill="none"
11
+ {...props}
12
+ >
13
+ <g clipPath="url(#clip0_13856_24182)">
14
+ <path d="M142.741 16.6087C141.067 10.3215 137.398 4.99979 131.11 3.32604C119.716 0.278958 72.9583 0 72.9583 0C72.9583 0 26.2006 0.278958 14.8063 3.32604C8.51896 4.99979 4.87104 10.3215 3.17583 16.6087C0.12875 28.0031 0 51.5 0 51.5C0 51.5 0.12875 74.9969 3.17583 86.3912C4.84958 92.6785 8.51896 98.0002 14.8063 99.674C26.2006 102.721 72.9583 103 72.9583 103C72.9583 103 119.716 102.721 131.11 99.674C137.398 98.0002 141.067 92.6785 142.741 86.3912C145.788 74.9969 145.917 51.5 145.917 51.5C145.917 51.5 145.788 28.0031 142.741 16.6087Z" fill="#FF0000" />
15
+ <path d="M96.5625 51.5003L57.9375 30.042V72.9587" fill="white" />
16
+ </g>
17
+ <defs>
18
+ <clipPath id="clip0_13856_24182">
19
+ <rect width="145.917" height="103" fill="white" />
20
+ </clipPath>
21
+ </defs>
22
+ </svg>
23
+ );
24
+
25
+ export default SvgYoutubeButton;
26
+ /* tslint:enable */
@@ -21,7 +21,7 @@ export const Theme = createTheme({
21
21
  },
22
22
  ['&.Mui-focused + [data-popper-placement*="bottom"] .MuiOutlinedInput-notchedOutline']: {
23
23
  ...(ownerState.name === 'mobileSearch' && { // tslint:disable-line
24
- borderTop: isMobileOnly ? '2px solid #1976d2' : 0
24
+ borderTop: isMobileOnly ? '2px solid #005CCB' : 0
25
25
  })
26
26
  },
27
27
  ['&.Mui-focused .MuiInputLabel-root']: {
@@ -38,9 +38,9 @@ export const Theme = createTheme({
38
38
  ['&.Mui-focused + [data-popper-placement*="top"] > .MuiPaper-root']: {
39
39
  borderBottomLeftRadius: 0,
40
40
  borderBottomRightRadius: 0,
41
- borderLeft: '2px solid #1976d2',
42
- borderRight: '2px solid #1976d2',
43
- borderTop: '2px solid #1976d2',
41
+ borderLeft: '2px solid #005CCB',
42
+ borderRight: '2px solid #005CCB',
43
+ borderTop: '2px solid #005CCB',
44
44
  ...(ownerState.error && { // tslint:disable-line
45
45
  borderColor: '#d32f2f'
46
46
  })
@@ -48,15 +48,15 @@ export const Theme = createTheme({
48
48
  ['&.Mui-focused + [data-popper-placement*="bottom"] > .MuiPaper-root']: {
49
49
  borderTopLeftRadius: 0,
50
50
  borderTopRightRadius: 0,
51
- borderLeft: '2px solid #1976d2',
52
- borderRight: '2px solid #1976d2',
53
- borderBottom: '2px solid #1976d2',
51
+ borderLeft: '2px solid #005CCB',
52
+ borderRight: '2px solid #005CCB',
53
+ borderBottom: '2px solid #005CCB',
54
54
  ...(ownerState.error && { // tslint:disable-line
55
55
  borderColor: '#d32f2f'
56
56
  }),
57
57
  marginTop: '-3px',
58
58
  ...(ownerState.name === 'mobileSearch' && { // tslint:disable-line
59
- borderTop: isMobileOnly ? '2px solid #1976d2' : 0,
59
+ borderTop: isMobileOnly ? '2px solid #005CCB' : 0,
60
60
  marginTop: 0,
61
61
  borderTopRightRadius: 4,
62
62
  borderTopLeftRadius: 4
@@ -37,8 +37,8 @@ export const Theme = createTheme({
37
37
  borderTopLeftRadius: 0,
38
38
  borderTopRightRadius: 0,
39
39
  transformOrigin: '0 0 !important',
40
- boxShadow: 'inset 2px 0px 0px 0px #1976d2, inset -2px 0px 0px 0px #1976d2',
41
- borderBottom: '2px solid #1976d2',
40
+ boxShadow: 'inset 2px 0px 0px 0px #005CCB, inset -2px 0px 0px 0px #005CCB',
41
+ borderBottom: '2px solid #005CCB',
42
42
  ['& > .MuiList-root']: {
43
43
  paddingRight: '0 !important',
44
44
  width: '100% !important'
@@ -48,12 +48,12 @@ export const Theme = createTheme({
48
48
  },
49
49
  ['::-webkit-scrollbar-track']: {
50
50
  background: '#fff',
51
- borderRight: '2px solid #1976d2',
51
+ borderRight: '2px solid #005CCB',
52
52
  boxShadow: 'inset -4px 0 0 0 #fff'
53
53
  },
54
54
  ['::-webkit-scrollbar-thumb']: {
55
55
  backgroundColor: '#e8e8e8',
56
- borderRight: '2px solid #1976d2',
56
+ borderRight: '2px solid #005CCB',
57
57
  boxShadow: 'inset -4px 0 0 0 #fff'
58
58
  },
59
59
  ['::-webkit-scrollbar-thumb:hover']: {
@@ -23,13 +23,18 @@ const OfferRequestBtnWrapper: React.FunctionComponent<IOfferRequestButtonWrapper
23
23
  const dealerId = _get(car, 'metaData.ownerId') || null;
24
24
  const carId = _get(car, '_id', '');
25
25
  const onAutoDeIdClick = () => {
26
- btnEl.current.onClick();
26
+ btnEl.current?.click();
27
27
  };
28
28
 
29
29
  const controlsContainerClassName = classnames(
30
30
  styles.controlsContainer,
31
31
  controlsClassContainer
32
32
  );
33
+
34
+ const getRef = (ref: HTMLButtonElement): void => {
35
+ btnEl.current = ref;
36
+ };
37
+
33
38
  return (
34
39
  <>
35
40
  <div className={controlsContainerClassName}>
@@ -41,8 +46,9 @@ const OfferRequestBtnWrapper: React.FunctionComponent<IOfferRequestButtonWrapper
41
46
  _: void,
42
47
  isLoading: boolean,
43
48
  isSale: boolean,
44
- isAlternative: boolean
45
- ) => {
49
+ isAlternative: boolean,
50
+ isSuccess: boolean
51
+ ) => {
46
52
  const { metaData } = car;
47
53
  const isAlternativeType = !!metaData && !!metaData.type;
48
54
  const offerButtonClassName = classnames(
@@ -52,10 +58,12 @@ const OfferRequestBtnWrapper: React.FunctionComponent<IOfferRequestButtonWrapper
52
58
  { [styles.isAlternativeButton]: isAlternative || isSale || isAlternativeType }
53
59
  );
54
60
 
61
+
55
62
  const getRequestButtonTitle = () => {
56
63
  if (isSale) return t('sidebar.requestOfferSale');
57
64
  // tslint:disable-next-line:no-else-after-return
58
65
  else if (isAlternativeType) return t('sidebar.importRequest');
66
+ else if (isSuccess) return t('CheckoutPage:onlineCheckoutModal.toMyOrder');
59
67
  else if (hasCheckout) return t('vehicleProps:title.toCheckoutCar');
60
68
  else if (isOfferRequested) return t('CheckoutPage:onlineCheckoutModal.redirectBtn');
61
69
  else return t('sidebar.requestOffer');
@@ -63,10 +71,10 @@ const OfferRequestBtnWrapper: React.FunctionComponent<IOfferRequestButtonWrapper
63
71
 
64
72
  return (
65
73
  <StyledButton
66
- refs={btnEl}
67
74
  className={offerButtonClassName}
68
75
  onClick={onClick}
69
76
  loading={isLoading}
77
+ getRef={getRef}
70
78
  >
71
79
  {isOfferRequested
72
80
  ? null
@@ -148,3 +148,6 @@ $indent = 10px
148
148
 
149
149
  .new
150
150
  text-transform: uppercase
151
+
152
+ .imagesCount
153
+ margin-left: 0 !important
@@ -71,7 +71,7 @@ const withStats = (WrappedComponent: any) => ({
71
71
  const delimiters = { xs: '|', sm: '|', md: 'von' };
72
72
 
73
73
  return (
74
- <div className={styles.section}>
74
+ <div className={classnames(styles.section, styles.imagesCount)}>
75
75
  {statsSize === 'md' ? <IconSVG name='common_camera' customDimensions className={styles.cameraIcon} /> : null}
76
76
  {!!imagesCount && <span>{`${activeSlide + 1} ${delimiters[statsSize]} ${imagesCount}`}</span>}
77
77
  </div>
@@ -115,20 +115,23 @@ const withStats = (WrappedComponent: any) => ({
115
115
  const favoritesIconClassName = classnames(styles.statsStarIcon, { [styles.accented]: isFavoured });
116
116
 
117
117
  return (
118
- <div className={styles.section}>
119
- {!!totalCarImpCount ? <div className={styles.statsViewsCount}>
120
- <IconSVG name='common_SliderEye' customDimensions className={styles.statsEyeIcon} />
121
- <span>
122
- {totalCarImpCount}
123
- </span>
124
- </div> : null}
125
- {!!totalFavCount ? <div className={favoritesClassName} onClick={onFavoriteClick}>
126
- <IconSVG name='star' customDimensions className={favoritesIconClassName} />
127
- <span>
128
- {totalFavCount}
129
- </span>
130
- </div> : null}
131
- </div>
118
+ <>
119
+ {(!!totalCarImpCount || !!totalFavCount) && <div className={styles.section}>
120
+ {!!totalCarImpCount ? <div className={styles.statsViewsCount}>
121
+ <IconSVG name='common_SliderEye' customDimensions className={styles.statsEyeIcon} />
122
+ <span>
123
+ {totalCarImpCount}
124
+ </span>
125
+ </div> : null}
126
+ {!!totalFavCount ? <div className={favoritesClassName} onClick={onFavoriteClick}>
127
+ <IconSVG name='star' customDimensions className={favoritesIconClassName} />
128
+ <span>
129
+ {totalFavCount}
130
+ </span>
131
+ </div> : null}
132
+ </div>
133
+ }
134
+ </>
132
135
  );
133
136
  };
134
137
 
@@ -57,7 +57,9 @@
57
57
  .vehicleId
58
58
  padding: 11px
59
59
  background-color: #fff
60
-
60
+ border-bottom: 1px solid #e8e8e8;
61
+ padding-bottom: 19px;
62
+
61
63
  .vehicleIdLabel
62
64
  font-size: 14px
63
65
  font-weight: 700
@@ -34,7 +34,7 @@ interface IFiltersContainerProps extends IRouteComponentProps<PathParamsType> {
34
34
  aggregation: {};
35
35
  setActiveSorting: (newActiveSorting: string) => void;
36
36
  setLastSearchString: (filters: IFilters, query: string) => void;
37
- search: (filters: any, page?: number, getStats?: boolean) => void;
37
+ search: (filters: any, page?: number, getStats?: boolean, vehicleID?: string|null) => void;
38
38
  resetFiltersToDefault: () => void;
39
39
  clearSearchState: (clearSorting?: boolean) => void;
40
40
  addMmsGroup: () => void;
@@ -55,7 +55,7 @@ interface IFiltersContainerProps extends IRouteComponentProps<PathParamsType> {
55
55
  t?: (phrase: string) => string;
56
56
  isDealerPage?: boolean;
57
57
  isAlternative?: boolean;
58
- isReferenceSearch?: boolean;
58
+ vehicleID?: string;
59
59
  successTransition?: boolean;
60
60
  isErrorAlternativeField: boolean;
61
61
  Link?: any;
@@ -68,11 +68,11 @@ class FiltersContainer extends React.Component<IFiltersContainerProps, {}> {
68
68
  }
69
69
 
70
70
  componentDidUpdate(prevProps: IFiltersContainerProps) {
71
- const { location, filters, resetFiltersToDefault, clearSearchState, search, activeSorting, setActiveSorting, isReferenceSearch } = this.props;
71
+ const { location, filters, resetFiltersToDefault, clearSearchState, search, activeSorting, setActiveSorting, vehicleID } = this.props;
72
+ console.log('vehicleID', vehicleID);
72
73
  if (
73
74
  (prevProps.location.search !== location.search) &&
74
- !_startsWith(location.search, '?pageNumber') &&
75
- !isReferenceSearch)
75
+ !_startsWith(location.search, '?pageNumber'))
76
76
  {
77
77
  const queryFromFilters = this.getQueryFromFilters();
78
78
  const prevQueryFromFilters = ['pageNumber', 'activeSort'].reduce((url, param) => url.replace(new RegExp(`(^${param}=\\w*&|&${param}=\\w*)`), ''), prevProps.location.search.slice(1));
@@ -93,7 +93,7 @@ class FiltersContainer extends React.Component<IFiltersContainerProps, {}> {
93
93
  }
94
94
 
95
95
  clearSearchState(!activeSort);
96
- search(filters, Number(pageNumber) || 1, true);
96
+ search(filters, Number(pageNumber) || 1, true, vehicleID);
97
97
  }
98
98
 
99
99
  this.updateFinancingSearchConfig();
@@ -314,7 +314,7 @@ class FiltersContainer extends React.Component<IFiltersContainerProps, {}> {
314
314
  if (isHistogram) {
315
315
  const histogramData = histograms[filterField].length ? histograms[filterField] : RANGE_FILTERS[filter].options;
316
316
  const actualValues = {
317
- from: histogramData[0].from,
317
+ from: filters[filter].value.from ? filters[filter].value.from : histogramData[0].from,
318
318
  to: histogramData[histogramData.length - 1].to
319
319
  };
320
320
 
@@ -32,6 +32,7 @@ export interface IImage {
32
32
  isSimpleTemp: boolean;
33
33
  isInProcessing: boolean;
34
34
  isTemp: boolean;
35
+ videoUrl:string; // youtube link that can be used in src in youtube video,
35
36
  }
36
37
 
37
38
  export interface IPrice {
@@ -251,6 +252,7 @@ export interface IVehicleDetailedSidebarProps {
251
252
  isAlternative?: boolean;
252
253
  onCurrentSalesPriceChange: (price: number) => void;
253
254
  className?: string;
255
+ isFetching?: boolean;
254
256
  }
255
257
 
256
258
  interface IOfferRequestButtonWrapper {
@@ -547,6 +547,7 @@ export function setUtmParameters() {
547
547
  const domain = parsedUrl.hostname.split('.').slice(-2).join('.');
548
548
 
549
549
  document.cookie = `marketing=${JSON.stringify(marketing)};expires=${expiresDate};domain=.${domain};path=/`;
550
+
550
551
  }
551
552
 
552
553
  export const updateCookieList = (handleSentryInit: () => void) => {
@@ -91,3 +91,11 @@ export const getYears = (minYear = 1980, maxYear = moment().year(), reverse = fa
91
91
  export const createDateAsUTC = (date: Date): Date => new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()));
92
92
 
93
93
  // end for checkout datepicker
94
+
95
+ export const fromUTCToDateString = (UTCDate: Date) => {
96
+ const date = new Date(UTCDate);
97
+ const day = date.getUTCDate().toString().padStart(2, '0');
98
+ const month = (date.getUTCMonth() + 1).toString().padStart(2, '0');
99
+ const year = date.getUTCFullYear();
100
+ return `${day}.${month}.${year}`;
101
+ }