@bytebrand/fe-ui-core 4.3.0 → 4.4.0

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__/components/UserDasboardPage/sections/CheckoutSection/CheckoutSection.test.tsx +613 -0
  2. package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx +335 -0
  3. package/__tests__/utils/CommonUtils/getOfferSliders.test.ts +4 -2
  4. package/common.ts +6 -2
  5. package/package.json +19 -28
  6. package/source/components/AccordionWidget/AccordionWidget.tsx +1 -3
  7. package/source/components/Breadcrumbs/Breadcrumbs.tsx +3 -3
  8. package/source/components/Checkout/CheckoutStepper/CheckoutStepper.styl +2 -190
  9. package/source/components/Checkout/CheckoutStepper/CheckoutStepper.tsx +15 -16
  10. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.styl +2 -2
  11. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.tsx +3 -3
  12. package/source/components/FormattedNumber/FormattedNumber.tsx +2 -3
  13. package/source/components/InfoBlocks/FirstInfoBlock/FirstInfoBlockItem/FirstInfoBlockItem.styl +4 -6
  14. package/source/components/OfferDetailedSection/partials/PanelConfig.tsx +0 -3
  15. package/source/components/OfferPanel/MuiOfferPeriod/{MuiOfferPeriod.theme.js → MuiOfferPeriod.theme.tsx} +8 -13
  16. package/source/components/OfferPanel/MuiOfferPeriod/MuiOfferPeriod.tsx +28 -4
  17. package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +6 -12
  18. package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +1 -1
  19. package/source/components/OfferPanel/OfferPanel.tsx +1 -1
  20. package/source/components/OfferPanel/OfferPeriod/OfferPeriod.tsx +0 -4
  21. package/source/components/OfferPanel/RangeGroup/RangeGroup.tsx +6 -4
  22. package/source/components/PriceRatingDetailed/PriceRatingDetailed.tsx +6 -2
  23. package/source/components/SearchFilters/filters/AlternativeID.tsx +42 -53
  24. package/source/components/SearchFilters/filters/DriveType.tsx +1 -1
  25. package/source/components/SearchFilters/filters/EmissionSticker.tsx +1 -1
  26. package/source/components/SearchFilters/filters/FirstRegistration.tsx +0 -1
  27. package/source/components/SearchFilters/filters/InteriorColor.tsx +1 -1
  28. package/source/components/SearchFilters/filters/InteriorMaterial.tsx +2 -1
  29. package/source/components/SearchFilters/filters/Mileage.tsx +1 -1
  30. package/source/components/SearchFilters/filters/Power.tsx +36 -17
  31. package/source/components/SearchFilters/filters/StateOptions.tsx +0 -1
  32. package/source/components/SearchFilters/filters/Transmission.tsx +1 -1
  33. package/source/components/SearchPage/SearchChips/SearchChips.tsx +1 -1
  34. package/source/components/SearchPageMobile/FiltersDetailed/BodyType.tsx +3 -3
  35. package/source/components/SearchPageMobile/FiltersDetailed/Consumption.tsx +2 -2
  36. package/source/components/SearchPageMobile/FiltersDetailed/Doors.tsx +1 -1
  37. package/source/components/SearchPageMobile/FiltersDetailed/MakeModel.tsx +1 -1
  38. package/source/components/SearchWidget/ColorWidget/BodyColorWidget.tsx +3 -3
  39. package/source/components/SearchWidget/EnvironmentWidget/EnvironmentWidget.tsx +3 -3
  40. package/source/components/SearchWidget/HighlightsWidget/HighlightsWidget.tsx +2 -2
  41. package/source/components/SearchWidget/StateWidget/StateWidget.tsx +1 -2
  42. package/source/components/SearchWidgetsMobile/BasicDataWidgetMobile/BasicDataWidgetMobile.tsx +4 -4
  43. package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidget.tsx +16 -16
  44. package/source/components/SearchWidgetsMobile/HighlightsWidgetMobile/HighlightsWidgetMobile.tsx +1 -1
  45. package/source/components/SearchWidgetsMobile/InteriorWidget/InteriorWidget.tsx +1 -1
  46. package/source/components/SearchWidgetsMobile/SafetyWidget/SafetyWidget.tsx +6 -6
  47. package/source/components/Stepper/Stepper.tsx +4 -3
  48. package/source/components/UserDashboardPage/sections/CheckoutSection/CheckoutSection.styl +38 -0
  49. package/source/components/UserDashboardPage/sections/CheckoutSection/CheckoutSection.tsx +120 -0
  50. package/source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection.styl +22 -0
  51. package/source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection.tsx +84 -0
  52. package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.styl +11 -2
  53. package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.tsx +5 -5
  54. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCar.tsx +57 -38
  55. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCard.tsx +2 -2
  56. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.tsx +183 -101
  57. package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.tsx +5 -7
  58. package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.tsx +33 -7
  59. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.styl +10 -2
  60. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +54 -14
  61. package/source/components/VehicleDetailedSidebar/partials/Price.styl +5 -1
  62. package/source/components/VehicleDetailedSidebar/partials/Price.tsx +2 -1
  63. package/source/components/VehicleDetailedSidebar/partials/PriceContent.styl +16 -5
  64. package/source/components/VehicleDetailedSidebar/partials/PriceContent.tsx +9 -4
  65. package/source/components/VehicleDetailedSidebar/partials/Properties.tsx +1 -1
  66. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.styl +45 -0
  67. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +121 -42
  68. package/source/components/VehicleDetailedSlider/partials/PriceData.styl +4 -1
  69. package/source/components/VehicleDetailedSlider/partials/PriceData.tsx +8 -1
  70. package/source/components/VehicleDetailedSlider/partials/Stats.tsx +2 -2
  71. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +9 -7
  72. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +35 -1
  73. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.tsx +9 -3
  74. package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.styl +11 -2
  75. package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +2 -1
  76. package/source/components/VehicleSmallCard/VehicleSmallCard.styl +3 -1
  77. package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +3 -7
  78. package/source/components/_common/Badge/Badge.styl +3 -0
  79. package/source/components/_common/Badge/Badge.tsx +1 -1
  80. package/source/components/_common/Button/Button.tsx +5 -4
  81. package/source/components/_common/Checkbox/FormCheckbox.tsx +4 -4
  82. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.tsx +1 -1
  83. package/source/components/_common/Chip/Chip.tsx +1 -3
  84. package/source/components/_common/ExpansionPanel/ExpansionPanel.tsx +3 -3
  85. package/source/components/_common/IconSVG/IconSVGConfig.tsx +2 -0
  86. package/source/components/_common/IconSVG/SVG/flags/SK.tsx +0 -1
  87. package/source/components/_common/IconSVG/SVG/slider/360New.tsx +1 -1
  88. package/source/components/_common/IconSVG/SVG/slider/YoutubeButton.tsx +26 -0
  89. package/source/components/_common/MaterialAccordion/MaterialAccordion.tsx +22 -30
  90. package/source/components/_common/MaterialAutocomplete/MaterialAutocomplete.styled.tsx +8 -8
  91. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.styled.tsx +0 -1
  92. package/source/components/_common/MaterialSelect/MaterialSelect.styled.tsx +12 -15
  93. package/source/components/_common/MaterialSelect/MaterialSelect.tsx +3 -3
  94. package/source/components/_common/MaterialSwitch/MaterialSwitch.tsx +3 -1
  95. package/source/components/_common/MaterialTooltip/MaterialTooltip.styled.tsx +1 -1
  96. package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +3 -3
  97. package/source/components/_common/Modal/CookieModal.tsx +1 -3
  98. package/source/components/_common/Modal/Modal.styled.tsx +2 -1
  99. package/source/components/_common/Modal/Modal.tsx +1 -5
  100. package/source/components/_common/Modal/ModalsConfig.tsx +5 -1
  101. package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.styl +23 -7
  102. package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.tsx +84 -36
  103. package/source/components/_common/Modal/modals/PreviewCookieModal/PreviewCookieModal.styl +29 -14
  104. package/source/components/_common/Modal/modals/PreviewCookieModal/PreviewCookieModal.tsx +17 -10
  105. package/source/components/_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper.tsx +12 -4
  106. package/source/components/_common/Range/Range.tsx +27 -14
  107. package/source/components/_common/UserMenu/MaterialMenu.styled.tsx +0 -1
  108. package/source/components/_common/UserMenu/MaterialMenu.tsx +3 -3
  109. package/source/components/_common/UserMenu/MaterialMenuItem.tsx +42 -20
  110. package/source/components/_common/UserMenu/NestedMenu.tsx +1 -1
  111. package/source/components/_common/withStats/withStats.styl +3 -0
  112. package/source/components/_common/withStats/withStats.tsx +19 -16
  113. package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.styl +14 -1
  114. package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.tsx +78 -42
  115. package/source/framework/constants/common.ts +89 -60
  116. package/source/framework/constants/highlights.ts +1 -1
  117. package/source/framework/constants.ts +1 -1
  118. package/source/framework/types/types.ts +9 -4
  119. package/source/framework/utils/CommonUtils.ts +73 -62
  120. package/source/framework/utils/DateUtils.ts +10 -2
  121. package/source/framework/vehiclesProps/decoratedLightProps.tsx +1 -2
  122. package/source/framework/vehiclesProps/decoratedProps.tsx +1 -2
  123. package/source/locales/data.ts +2 -2
  124. package/tslint.json +1 -2
  125. package/utils.ts +2 -0
@@ -8,7 +8,7 @@ export const IconSvgWrapper = styled(IconSVG)(props => ({
8
8
  height: '10px'
9
9
  }));
10
10
 
11
- export const TooltipWrapper = styled('div')(props => ({
11
+ export const TooltipWrapper = styled('div')(() => ({
12
12
  // zIndex: props.zindex ? props.zindex : 9996,
13
13
  display: 'inline-block'
14
14
  }));
@@ -17,8 +17,8 @@ interface IMaterialTooltip {
17
17
 
18
18
  const LightTooltip = styled(({ className, ...props }: TooltipProps) => (
19
19
  <Tooltip {...props} classes={{ popper: className }} />
20
- ))(props => ({
21
- zIndex: props.zindex ? props.zindex : 9996,
20
+ ))(({ zindex }: { zindex: number }) => ({
21
+ zIndex: zindex ? zindex : 9996,
22
22
  [`& .${tooltipClasses.tooltip}`]: {
23
23
  backgroundColor: '#fff',
24
24
  color: '#4C4E64AD',
@@ -46,7 +46,7 @@ const MaterialTooltip = ({ text, placement, className, disabled, zindex }: IMate
46
46
  };
47
47
 
48
48
  const onHandleMenuToggle = debounce(
49
- (event: any) => {
49
+ (_: any) => {
50
50
  setIsOpen(() => !isOpen);
51
51
  },
52
52
  50
@@ -3,7 +3,6 @@ import useModal from '../../../framework/hooks/useModal';
3
3
  import { updateCookieList } from '../../../framework/utils/CommonUtils';
4
4
  import Modal from './Modal';
5
5
 
6
-
7
6
  export interface ICookieModal {
8
7
  handleSentryInit?: () => void;
9
8
  }
@@ -43,9 +42,8 @@ const CookieModal = ({ handleSentryInit }: ICookieModal) => {
43
42
  : <></>;
44
43
  };
45
44
 
46
-
47
45
  CookieModal.defaultProps = {
48
- handleSentryInit: () => {},
46
+ handleSentryInit: () => {}
49
47
  };
50
48
 
51
49
  export default CookieModal;
@@ -10,5 +10,6 @@ export const BaseModalWrapper = styled('div')({
10
10
  boxShadow: '0px 0px 20px rgba(76, 78, 100, 0.4)',
11
11
  borderRadius: '10px',
12
12
  maxWidth: '600px',
13
- boxSizing: 'border-box'
13
+ boxSizing: 'border-box',
14
+ outline: 'none'
14
15
  });
@@ -12,12 +12,8 @@ interface IBasicModal {
12
12
  }
13
13
 
14
14
  const BasicModal = ({ isVisible, toggleModal, name, modalProps, handleSentryInit }: IBasicModal) => {
15
- const { onClearModalState } = modalProps;
16
15
  return (
17
- <Modal open={isVisible} onClose={() => {
18
- // toggleModal();
19
- // onClearModalState();
20
- }}>
16
+ <Modal open={isVisible}>
21
17
  <BaseModalWrapper>
22
18
  {ModalsConfig[name] && ModalsConfig[name]({ ...modalProps, toggleModal, handleSentryInit })}
23
19
  </BaseModalWrapper>
@@ -4,7 +4,11 @@ import TestModal from './modals/TestModal';
4
4
  import PreviewCookieModal from './modals/PreviewCookieModal/PreviewCookieModal';
5
5
  import ManageCookieModal from './modals/ManageCookieModal/ManageCookieModal';
6
6
 
7
- const ModalsConfig = {
7
+ interface IModalConfigProps {
8
+ [key: string]: (props: any) => JSX.Element;
9
+ }
10
+
11
+ const ModalsConfig: IModalConfigProps = {
8
12
  TEST_MODAL: (props: any) => {
9
13
  return <TestModal { ...props } />;
10
14
  },
@@ -1,7 +1,7 @@
1
1
  @import '../../../../../theme/mixins.styl';
2
2
 
3
3
  .modalWrapper
4
- padding: 16px 10px 25px 25px
4
+ padding: 13px 15px 28px;
5
5
  text-align: center
6
6
  box-sizing: border-box
7
7
  max-width: 600px
@@ -9,10 +9,13 @@
9
9
  .modalTitle
10
10
  font-family: sans-serif
11
11
  font-weight: bold
12
- font-size: 24px;
12
+ font-size: 16px;
13
13
  line-height: 133.4%;
14
14
  color: rgba(76, 78, 100, 0.87)
15
- margin-top: 20px
15
+ margin-top: 12px
16
+ +media-tablet-up()
17
+ font-size: 24px;
18
+ margin-top: 20px
16
19
 
17
20
  .modalContent
18
21
  font-family: sans-serif
@@ -21,9 +24,11 @@
21
24
  text-align: justify;
22
25
  letter-spacing: 0.15px;
23
26
  color: rgba(76, 78, 100, 0.87);
24
- margin-top: 20px
27
+ margin-top: 12px
25
28
  margin-right: 25px
26
29
 
30
+ +media-tablet-up()
31
+ margin-top: 20px
27
32
  .accordions
28
33
  height: 278px
29
34
  overflow-y: scroll
@@ -52,7 +57,6 @@
52
57
  .modalBtn
53
58
  height: 38px
54
59
  text-transform: capitalize !important
55
- font-size: 11px !important;
56
60
  +media-tablet-landscape-up()
57
61
  min-width: 222px !important
58
62
  font-size: 14px !important;
@@ -62,10 +66,22 @@
62
66
 
63
67
  .switchBlock
64
68
  display: flex
65
- justify-content: space-between
66
69
  align-items: center
67
70
  font-size: 12px
68
71
  line-height: 15px
69
72
  letter-spacing: 1px
70
73
  color: rgba(76, 78, 100, 0.87)
71
- text-align: left
74
+ text-align: left
75
+
76
+ .switchBlockTitle
77
+ width: 140px;
78
+
79
+ .switchBlockLink
80
+ color: rgba(76, 78, 100, 0.87);
81
+ text-decoration-line: underline;
82
+ font-size: 10px;
83
+
84
+ &:focus
85
+ text-decoration-line: underline;
86
+ &:hover
87
+ text-decoration-line: none;
@@ -1,12 +1,12 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import _merge from 'lodash/merge';
3
3
  import classNames from 'classnames';
4
-
4
+ import _get from 'lodash/get';
5
5
  import IconSVG from '../../../IconSVG/IconSVG';
6
6
  import Button from '../../../Button/Button';
7
7
  import MaterialAccordionGroup from '../../../MaterialAccordionGroup/MaterialAccordionGroup';
8
8
  import MaterialSwitch from '../../../MaterialSwitch/MaterialSwitch';
9
- import { COOKIE_SCHEMA } from '../../../../../framework/constants/common';
9
+ import { COOKIE_SCHEMA, COOKIE_SCHEMA_LINKS } from '../../../../../framework/constants/common';
10
10
  import { updateCookieList } from '../../../../../framework/utils/CommonUtils';
11
11
 
12
12
  import styles from './ManageCookieModal.styl';
@@ -16,16 +16,25 @@ interface IManageCookieModal {
16
16
  handleSentryInit?: () => void;
17
17
  }
18
18
 
19
+ interface IMarketingSwitches {
20
+ [key: string]: any;
21
+ }
22
+
19
23
  const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModal) => {
20
- const [analytcisMasterSwitch, setAnalyticsMasterSwitch] = useState(true);
21
- const [marketingMasterSwitch, setMarketingMasterSwitch] = useState(true);
22
- const [analyticsSwitches, setAnalyticsSwitches] = useState({});
23
- const [marketingSwitches, setMarketingSwitches] = useState({});
24
+ const [analytcisMasterSwitch, setAnalyticsMasterSwitch] = useState(false);
25
+ const [marketingMasterSwitch, setMarketingMasterSwitch] = useState(false);
26
+ const [analyticsSwitches, setAnalyticsSwitches] = useState<IMarketingSwitches>({});
27
+ const [marketingSwitches, setMarketingSwitches] = useState<IMarketingSwitches>({});
24
28
 
25
29
  useEffect(
26
30
  () => {
27
- const newAnalyticsSwitches = Object.keys(COOKIE_SCHEMA.analytics).reduce((acc, item) => ({ ...acc, [item]: true }), {});
28
- const newMarketingSwitches = Object.keys(COOKIE_SCHEMA.marketing).reduce((acc, item) => ({ ...acc, [item]: true }), {});
31
+ const newAnalyticsSwitches = Object.values(COOKIE_SCHEMA.analytics)
32
+ .reduce((acc, val) => acc.concat(val), [])
33
+ .reduce((acc, item) => ({ ...acc, [item]: false }), {});
34
+
35
+ const newMarketingSwitches = Object.values(COOKIE_SCHEMA.marketing)
36
+ .reduce((acc, val) => acc.concat(val), [])
37
+ .reduce((acc, item) => ({ ...acc, [item]: false }), {});
29
38
  setAnalyticsSwitches(newAnalyticsSwitches);
30
39
  setMarketingSwitches(newMarketingSwitches);
31
40
  },
@@ -33,13 +42,18 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModa
33
42
  );
34
43
 
35
44
  const onHandleAnalyticsSwitchValue = (value: boolean) => {
36
- const newAnalyticsSwitches = Object.keys(analyticsSwitches).reduce((acc, item) => ({ ...acc, [item]: value }), {});
45
+ const newAnalyticsSwitches = Object.values(COOKIE_SCHEMA.analytics)
46
+ .reduce((acc, val) => acc.concat(val), [])
47
+ .reduce((acc, item) => ({ ...acc, [item]: value }), {});
48
+
37
49
  setAnalyticsSwitches(newAnalyticsSwitches);
38
50
  setAnalyticsMasterSwitch(value);
39
51
  };
40
52
 
41
53
  const onHandleMarketingSwitchValue = (value: boolean) => {
42
- const newMarketingSwitches = Object.keys(marketingSwitches).reduce((acc, item) => ({ ...acc, [item]: value }), {});
54
+ const newMarketingSwitches = Object.values(COOKIE_SCHEMA.marketing)
55
+ .reduce((acc, val) => acc.concat(val), [])
56
+ .reduce((acc, item) => ({ ...acc, [item]: value }), {});
43
57
  setMarketingSwitches(newMarketingSwitches);
44
58
  setMarketingMasterSwitch(value);
45
59
  };
@@ -60,7 +74,7 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModa
60
74
  onChange: () => {}
61
75
  };
62
76
 
63
- const onAccept = (value?: object) => {
77
+ const onAccept = (value?: Record<string, any>) => {
64
78
  const cookieConfig = value || {
65
79
  marketing: Object.keys(marketingSwitches).filter(i => !marketingSwitches[i]) || [],
66
80
  analytics: Object.keys(analyticsSwitches).filter(i => !analyticsSwitches[i]) || []
@@ -69,6 +83,22 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModa
69
83
  updateCookieList(handleSentryInit);
70
84
  toggleModal();
71
85
  };
86
+
87
+ const onHandleChangeInnerSwitchAnalytics = (cookiesFromCategory: any, isChecked: boolean) => {
88
+ const updatedSwitches = { ...analyticsSwitches };
89
+ for (const item of cookiesFromCategory) {
90
+ updatedSwitches[item] = !isChecked
91
+ }
92
+ setAnalyticsSwitches(updatedSwitches);
93
+ };
94
+
95
+ const onHandleChangeInnerSwitchMarketing = (cookiesFromCategory: any, isChecked: boolean) => {
96
+ const updatedSwitches = { ...marketingSwitches };
97
+ for (const item of cookiesFromCategory) {
98
+ updatedSwitches[item] = !isChecked
99
+ }
100
+ setMarketingSwitches(updatedSwitches);
101
+ };
72
102
 
73
103
  return (
74
104
  <div className={styles.modalWrapper}>
@@ -83,12 +113,16 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModa
83
113
  switchProps={necessarySwitchProps}
84
114
  >
85
115
  <span>Wir verwenden Browser-Cookies, die notwendig sind, damit die Website wie vorgesehen funktioniert. Beispiel: Wir speichern Ihre Präferenzen bei der Datenerfassung auf der Website, damit wir sie berücksichtigen können, wenn Sie auf unsere Website zurückkehren. Sie können diese Cookies in den Einstellungen Ihres Browsers deaktivieren, aber wenn Sie dies tun, funktioniert die Website möglicherweise nicht wie vorgesehen.</span>
86
- {Object.keys(COOKIE_SCHEMA.necessary).map(cookie =>
87
- <div className={styles.switchBlock} key={cookie} >
88
- <span>{`${COOKIE_SCHEMA.necessary[cookie].name} (${cookie})`}</span>
89
- <MaterialSwitch disabled={true} value={true} onChange={() => {}} />
90
- </div>
91
- )}
116
+ {Object.keys(COOKIE_SCHEMA.necessary).map(cookie => {
117
+ const getLinkFromCategory = _get(COOKIE_SCHEMA_LINKS, [cookie], '');
118
+ return (
119
+ <div className={styles.switchBlock} key={cookie} >
120
+ <span className={styles.switchBlockTitle}>{cookie}</span>
121
+ <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>Datenschutzbestimmungen</a>
122
+ <MaterialSwitch sx={{ marginLeft: 'auto' }} disabled={true} value={true} onChange={() => {}} />
123
+ </div>
124
+ );
125
+ })}
92
126
  </MaterialAccordionGroup>
93
127
  <MaterialAccordionGroup
94
128
  title='Analytisch'
@@ -97,15 +131,22 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModa
97
131
  switchProps={analyticsSwitchProps}
98
132
  >
99
133
  <span>Um das Nutzerverhalten zu verstehen und Ihnen ein relevanteres Surferlebnis zu bieten oder den Inhalt unserer Website zu personalisieren. Beispiel: Wir sammeln Informationen darüber, welche Seiten Sie besuchen, damit wir Ihnen relevantere Informationen präsentieren können.</span>
100
- {Object.keys(COOKIE_SCHEMA.analytics).map(cookie =>
101
- <div className={styles.switchBlock} key={cookie} >
102
- <span>{`${COOKIE_SCHEMA.analytics[cookie].name} (${cookie})`}</span>
103
- <MaterialSwitch
104
- value={analyticsSwitches[cookie]}
105
- onChange={() => { setAnalyticsSwitches(s => ({ ...s, [cookie]: !s[cookie] })); }}
106
- />
107
- </div>
108
- )}
134
+ {Object.keys(COOKIE_SCHEMA.analytics).map(cookie => {
135
+ const getItemsFromCategory = _get(COOKIE_SCHEMA, `analytics['${cookie}']`, null);
136
+ const getLinkFromCategory = _get(COOKIE_SCHEMA_LINKS, [cookie], '');
137
+ const isChecked = getItemsFromCategory.every((item: string) => analyticsSwitches[item] === false);
138
+ return (
139
+ <div className={styles.switchBlock} key={cookie} >
140
+ <span className={styles.switchBlockTitle}>{cookie}</span>
141
+ <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>Datenschutzbestimmungen</a>
142
+ <MaterialSwitch
143
+ sx={{ marginLeft: 'auto' }}
144
+ value={analytcisMasterSwitch}
145
+ onChange={() => onHandleChangeInnerSwitchAnalytics(getItemsFromCategory, isChecked)}
146
+ />
147
+ </div>
148
+ );
149
+ })}
109
150
  </MaterialAccordionGroup>
110
151
  <MaterialAccordionGroup
111
152
  title='Marketing'
@@ -114,19 +155,26 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModa
114
155
  switchProps={marketingSwitchProps}
115
156
  >
116
157
  <span>Zur Personalisierung und Messung der Effektivität von Werbung auf unserer Website und anderen Websites. Beispiel: Wir können Ihnen eine personalisierte Werbung auf der Grundlage der von Ihnen besuchten Seiten auf unserer Website anzeigen.</span>
117
- {Object.keys(COOKIE_SCHEMA.marketing).map(cookie =>
118
- <div className={styles.switchBlock} key={cookie} >
119
- <span>{`${COOKIE_SCHEMA.marketing[cookie].name} (${cookie})`}</span>
120
- <MaterialSwitch
121
- value={marketingSwitches[cookie]}
122
- onChange={() => setMarketingSwitches(s => ({ ...s, [cookie]: !s[cookie] }))}
123
- />
124
- </div>
125
- )}
158
+ {Object.keys(COOKIE_SCHEMA.marketing).map(cookie => {
159
+ const getItemsFromCategory = _get(COOKIE_SCHEMA, `marketing['${cookie}']`, null);
160
+ const getLinkFromCategory = _get(COOKIE_SCHEMA_LINKS, [cookie], '');
161
+ const isChecked = getItemsFromCategory.every((item: string) => marketingSwitches[item] === false);
162
+ return (
163
+ <div className={styles.switchBlock} key={cookie} >
164
+ <span className={styles.switchBlockTitle}>{cookie}</span>
165
+ <a className={styles.switchBlockLink} href={getLinkFromCategory} target='_blank'>Datenschutzbestimmungen</a>
166
+ <MaterialSwitch
167
+ sx={{ marginLeft: 'auto' }}
168
+ value={marketingMasterSwitch}
169
+ onChange={() => onHandleChangeInnerSwitchMarketing(getItemsFromCategory, isChecked)}
170
+ />
171
+ </div>
172
+ )
173
+ })}
126
174
  </MaterialAccordionGroup>
127
175
  </div>
128
176
  <div className={styles.buttonsContainer}>
129
- <Button onClick={() => onAccept()}className={classNames(styles.modalBtn, styles.outlinedBtn)} variant='outlined'>Auswahl speichern</Button>
177
+ <Button onClick={() => onAccept()} className={classNames(styles.modalBtn, styles.outlinedBtn)} >Auswahl speichern</Button>
130
178
  <Button onClick={() => onAccept({})} className={styles.modalBtn}>Alles akzeptieren</Button>
131
179
  </div>
132
180
  </div>
@@ -1,12 +1,12 @@
1
1
  @import '../../../../../theme/mixins.styl';
2
2
 
3
3
  .modalWrapper
4
- padding: 26px 60px 38px
4
+ padding: 28px 58px 28px
5
5
  text-align: center
6
6
  box-sizing: border-box
7
7
  max-width: 600px
8
- +media-phone-only()
9
- padding: 13px 15px 28px
8
+ +media-tablet-down()
9
+ padding: 16px 15px 28px
10
10
 
11
11
  .modalTitle
12
12
  font-family: sans-serif
@@ -16,37 +16,52 @@
16
16
  color: rgba(76, 78, 100, 0.87)
17
17
  margin-top: 20px
18
18
 
19
+ +media-tablet-down()
20
+ font-size: 16px;
21
+ margin-top: 8px;
22
+
19
23
  .modalContent
20
24
  font-family: sans-serif
21
- font-size: 16px;
22
- line-height: 24px;
25
+ font-size: 14px;
26
+ line-height: 16px;
23
27
  text-align: justify;
24
28
  letter-spacing: 0.15px;
25
29
  color: rgba(76, 78, 100, 0.87);
26
30
  margin-top: 20px
27
- +media-phone-only()
28
- column-gap: 0
31
+ +media-tablet-down()
32
+ column-gap: 0;
33
+ max-height: 320px;
34
+ overflow-y: scroll;
35
+ padding-right: 10px;
36
+ margin-right: -10px;
37
+ margin-top: 8px
38
+
39
+ .logoContainer
40
+ display: flex
41
+ justify-content: space-between
29
42
 
30
43
  .buttonsContainer
31
- margin-top: 20px
44
+ margin-top: 12px
32
45
  display: flex
33
46
  justify-content: space-between
34
47
  gap: 36px;
35
- +media-phone-only()
48
+ +media-tablet-down()
36
49
  column-gap: 0
37
50
 
38
51
  .modalBtn
39
52
  height: 38px
40
53
  text-transform: capitalize !important
41
54
  min-width: calc(50% - 18px) !important
42
- +media-phone-only()
55
+ +media-tablet-down()
43
56
  font-size: 11px !important
44
57
 
45
58
  .outlinedBtnLeft
46
- float: right;
59
+ display: flex;
60
+ justify-content: flex-end;
47
61
  color: #005CCB;
48
62
  font-size: 16px;
49
63
  text-decoration: none;
50
-
51
- .clearfix
52
- clear: both;
64
+ margin-top: 12px;
65
+ margin-bottom: 0;
66
+ margin-left: auto;
67
+ max-width: 80px;
@@ -18,21 +18,28 @@ const PreviewCookieModal = ({ toggleModal, setModal, handleSentryInit } : IPrevi
18
18
  toggleModal();
19
19
  };
20
20
 
21
+ const onDisableAll = () => {
22
+ localStorage.setItem('cookieConfig', JSON.stringify({
23
+ 'marketing':['cf','cip','cnac','car','test_cookie','IDE', 'bid','youtube'],
24
+ 'analytics':['sentry','callback','locale','uid','PugT','demdex','cto_bundle','tuuid','tuuid_lu','c','CMID','CMPS','CMPRO','uuid2','um','umeh','KRTBCOOKIE_97','IDSYNC','dpm','_kuid_','visitor-id','data-c-ts','data-c','CMTS','mv_tokens','A3','mv_tokens_eu-v1','am_tokens','am_tokens_eu-v1','iteo','_fbp','_clck','_clsk','_uetsid','_uetvid','analytics_storage','ad_storage','functionality_storage','personalization_storage','security_storage','hotjar']
25
+ }));
26
+ updateCookieList(handleSentryInit);
27
+ toggleModal();
28
+ };
29
+
21
30
  return (
22
31
  <div className={styles.modalWrapper}>
23
- <IconSVG name='autodeLogo' customDimensions />
32
+ <div className={styles.logoContainer}>
33
+ <IconSVG name='autodeLogo' customDimensions />
34
+ <Button onClick={onDisableAll} className={styles.modalBtn}>Nur notwendige Cookies</Button>
35
+ </div>
24
36
  <div className={styles.modalTitle}>Nach den Cookies geht die Fahrt weiter.</div>
25
37
  <div className={styles.modalContent}>
26
- Wenn Sie auf "Zustimmen" klicken, ermöglichen Sie uns über Cookies das Nutzerverhalten
27
- für alle User zu optimieren und Ihnen individuelle Empfehlungen auch auf Drittseiten anzuzeigen.
28
- Durch die Zustimmung erteilen Sie uns Ihre ausdrückliche Einwilligung.
29
- Über "Anpassen" können Sie Ihre Einwilligungen individuell anpassen.
30
- Dies ist auch später jederzeit im Bereich "Cookie-Richtlinie" möglich.
31
- Die relevante Datenschutzerklärung finden Sie&nbsp;
32
- <a href={`${environment}/datenschutz/`} target='_blank' style={{ textDecoration: 'underline', color: 'rgba(76,78,100,0.87)' }}>hier</a>.
33
- <a href={`${environment}/impressum/`} target='_blank' className={styles.outlinedBtnLeft}>Impressum</a>
38
+ Wir verwenden Cookies und ähnliche Technologien (insg. „Cookies“). Cookies die notwendig sind, damit die Website wie vorgesehen funktioniert, werden standardmäßig gesetzt. Cookies, die dazu dienen das Nutzerverhalten zu verstehen und Ihnen ein relevantes bzw. personalisiertes Surferlebnis zu bieten, sowie Cookies zur Personalisierung und Messung der Effektivität von Werbung auf unserer und anderen Websites setzen wir nur mit Ihrer Einwilligung ein. Unsere Partner führen diese Daten möglicherweise mit weiteren Daten zusammen, die Sie ihnen bereitgestellt oder die sie im Rahmen Ihrer Nutzung gesammelt haben. Durch Klick auf "Zustimmen" akzeptieren Sie alle Cookies und die beschriebene Verarbeitung Ihrer Daten. Bevor Sie Ihre Zustimmung erteilen, beachten Sie bitte, dass wir Ihre Daten auch mit Partnern mit Sitz in den USA teilen. Die USA weisen kein mit der EU vergleichbares Datenschutzniveau auf. Es besteht das Risiko, dass US-Behörden Zugriff auf Ihre Daten haben und Sie Ihre Betroffenenrechte nicht durchsetzen können. Über "Anpassen" können Sie Ihre Einwilligungen individuell anpassen. Dies ist auch später jederzeit im Bereich&nbsp;
39
+ <a href={`${environment}/datenschutz/`} target='_blank' style={{ textDecoration: 'underline', color: 'rgba(76,78,100,0.87)' }}>Cookie-Richtlinie</a> möglich. Weitere Informationen finden Sie in unserer&nbsp;
40
+ <a href={`${environment}/datenschutz/`} target='_blank' style={{ textDecoration: 'underline', color: 'rgba(76,78,100,0.87)' }}>Datenschutzerklärung</a>.
34
41
  </div>
35
- <div className={styles.clearfix}></div>
42
+ <a href={`${environment}/impressum/`} target='_blank' className={styles.outlinedBtnLeft}>Impressum</a>
36
43
  <div className={styles.buttonsContainer}>
37
44
  <Button onClick={() => setModal('MANAGE_COOKIE_MODAL')} className={styles.modalBtn} variant='outlined'>Anpassen</Button>
38
45
  <Button onClick={onAcceptAll} className={styles.modalBtn}>zustimmen</Button>
@@ -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
@@ -1,8 +1,8 @@
1
- import React from 'react';
1
+ import React, { useState, useEffect } from 'react';
2
2
  import FormattedNumber from '../../FormattedNumber/FormattedNumber';
3
3
  import { Slider } from '@mui/material';
4
4
  import { isMobileOnly } from 'react-device-detect';
5
- import { ThemeProvider } from '@mui/material/styles';
5
+ import { createTheme, ThemeProvider } from '@mui/material/styles';
6
6
 
7
7
  interface IRangeProps {
8
8
  children?: JSX.Element;
@@ -11,10 +11,12 @@ interface IRangeProps {
11
11
  step: number;
12
12
  units: string;
13
13
  value: number;
14
+ withRangeLimit?: boolean;
14
15
  onChange: (event: Event, value: number | number[], activeThumb?: number) => void;
16
+ maxFinancingFirstInstallment?: number;
15
17
  }
16
18
 
17
- const Theme = {
19
+ const Theme = createTheme({
18
20
  components: {
19
21
  MuiSlider: {
20
22
  styleOverrides: {
@@ -22,15 +24,10 @@ const Theme = {
22
24
  padding: '2px 6px',
23
25
  fontSize: 12
24
26
  }
25
- },
26
- palette: {
27
- primary: {
28
- main: '#005CCB'
29
- }
30
27
  }
31
28
  }
32
- },
33
- };
29
+ }
30
+ });
34
31
 
35
32
  const Range: React.FC<IRangeProps> = ({
36
33
  min,
@@ -38,8 +35,24 @@ const Range: React.FC<IRangeProps> = ({
38
35
  step,
39
36
  value,
40
37
  units,
41
- onChange
38
+ withRangeLimit,
39
+ onChange,
40
+ maxFinancingFirstInstallment
42
41
  }: IRangeProps) => {
42
+ const [rangeValue, setRangeValue] = useState<number | number[]>(0);
43
+
44
+ useEffect(
45
+ () => {
46
+ setRangeValue(value);
47
+ },
48
+ [value]
49
+ )
50
+
51
+ const onChangeRange = (event: Event, value: number | number[]) => {
52
+ setRangeValue(value);
53
+ onChange(event, value)
54
+ }
55
+
43
56
  const formttedValue = (value: number) => {
44
57
  return (
45
58
  <>
@@ -52,13 +65,13 @@ const Range: React.FC<IRangeProps> = ({
52
65
  <ThemeProvider theme={Theme}>
53
66
  <Slider
54
67
  min={min}
55
- max={max}
68
+ max={withRangeLimit ? maxFinancingFirstInstallment : max}
56
69
  step={step}
57
70
  disableSwap={isMobileOnly ? true : false}
58
71
  valueLabelDisplay='auto'
59
72
  valueLabelFormat={formttedValue}
60
- value={value}
61
- onChange={(event: Event, value: number | number[]) => onChange(event, value)}
73
+ value={rangeValue}
74
+ onChange={onChangeRange}
62
75
  sx={{
63
76
  color: '#005CCB'
64
77
  }}
@@ -1,6 +1,5 @@
1
1
  import { styled } from '@mui/system';
2
2
  import { createTheme } from '@mui/material/styles';
3
- import zIndex from '@mui/material/styles/zIndex';
4
3
 
5
4
  export const Theme = createTheme({
6
5
  components: {
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState, MouseEvent } from 'react';
2
2
  import Menu from '@mui/material/Menu';
3
3
  import ListItem from './MaterialMenuItem';
4
4
  import { ThemeProvider } from '@mui/material/styles';
@@ -24,7 +24,7 @@ const MaterialMenu = ({ menuItems, headerComponent, onChange, isLang, containerC
24
24
  const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
25
25
  const [selectedIndex, setSelectedIndex] = React.useState(1);
26
26
  const open = Boolean(anchorEl);
27
- const handleClick = (event: React.MouseEvent<HTMLElement>) => {
27
+ const handleClick = (event: MouseEvent<HTMLDivElement>) => {
28
28
  setAnchorEl(event.currentTarget);
29
29
  };
30
30
  const handleClose = () => {
@@ -42,7 +42,7 @@ const MaterialMenu = ({ menuItems, headerComponent, onChange, isLang, containerC
42
42
  <ThemeProvider theme={Theme}>
43
43
  <div className={containerClassname}>
44
44
  <HeaderComponent
45
- onClick={(e) => {
45
+ onClick={(e: MouseEvent<HTMLDivElement>) => {
46
46
  if (anchorEl) {
47
47
  handleClose();
48
48
  } else {