@bytebrand/fe-ui-core 4.1.123 → 4.1.125
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
|
@@ -39,7 +39,7 @@ export interface IVehiclePriceSectionProps {
|
|
|
39
39
|
buy?: IBuy;
|
|
40
40
|
common: ICommonFinancing;
|
|
41
41
|
vatRate?: number;
|
|
42
|
-
onDetailsClick(
|
|
42
|
+
onDetailsClick(id: string): void;
|
|
43
43
|
toggleCarToCompare?(carId: string): void;
|
|
44
44
|
onRemoveClick?(carId: string): void;
|
|
45
45
|
toCompare?: boolean;
|
|
@@ -78,10 +78,10 @@ class VehiclePrice extends React.Component<IVehiclePriceSectionProps> {
|
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
onDetailsClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
81
|
-
const { id,
|
|
81
|
+
const { id, onDetailsClick } = this.props;
|
|
82
82
|
event.preventDefault();
|
|
83
83
|
event.stopPropagation();
|
|
84
|
-
onDetailsClick(
|
|
84
|
+
onDetailsClick(id);
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
render(): React.ReactNode {
|
|
@@ -3,6 +3,7 @@ import IconSVG from '../../../IconSVG/IconSVG';
|
|
|
3
3
|
import Button from '../../../Button/Button';
|
|
4
4
|
import styles from './PreviewCookieModal.styl';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
+
import { updateCookieList } from '../../../../../framework/utils/CommonUtils';
|
|
6
7
|
|
|
7
8
|
interface IPreviewCookieModal {
|
|
8
9
|
toggleModal: () => void;
|
|
@@ -12,6 +13,7 @@ interface IPreviewCookieModal {
|
|
|
12
13
|
const PreviewCookieModal = ({ toggleModal, setModal }: IPreviewCookieModal) => {
|
|
13
14
|
const onAcceptAll = () => {
|
|
14
15
|
localStorage.setItem('cookieConfig', JSON.stringify([]));
|
|
16
|
+
updateCookieList();
|
|
15
17
|
toggleModal();
|
|
16
18
|
};
|
|
17
19
|
|
|
@@ -10,13 +10,9 @@ import { priceRatings, priceRatingConfig } from '../constants/price';
|
|
|
10
10
|
import { HUNDRED } from '../constants/common';
|
|
11
11
|
import { offers } from '../constants';
|
|
12
12
|
import { FILTERS_IN_TITLE, MANUFACTURER_KEY, MAX_FILTERS_IN_TITLE, MODEL_KEY } from '../constants/Search';
|
|
13
|
-
import { config } from '../constants/app';
|
|
14
13
|
|
|
15
14
|
const PRICE_DEFAULT = DROP_DOWN_GROUP[PRICE].defaultValue;
|
|
16
15
|
|
|
17
|
-
// const RANGE_FILTERS = [FIRST_REGISTRATION, MILEAGE, PRICE];
|
|
18
|
-
// const ARRAY_RANGE_FILTERS = [FIRST_REGISTRATION, MILEAGE];
|
|
19
|
-
|
|
20
16
|
export const formatMileage = (millage: number | string) => {
|
|
21
17
|
return millage.toLocaleString('en-US').replace(/,/g, '.');
|
|
22
18
|
};
|
|
@@ -535,12 +531,15 @@ export function setUtmParameters() {
|
|
|
535
531
|
}
|
|
536
532
|
|
|
537
533
|
export const updateCookieList = () => {
|
|
534
|
+
let isGoogleConsentGranted = true;
|
|
538
535
|
const cookieConfig = JSON.parse(localStorage.getItem('cookieConfig')) || {};
|
|
539
536
|
const parsedUrl = new URL(window.location.href);
|
|
540
537
|
const domain = parsedUrl.hostname.split('.').slice(-2).join('.');
|
|
541
538
|
Object.keys(cookieConfig).forEach((group: string) => {
|
|
542
539
|
cookieConfig[group].forEach((cookie: string) => {
|
|
543
|
-
Cookies.remove(cookie, { domain, path: '/' });
|
|
540
|
+
Cookies.remove(cookie, { domain, path: '/' }); // manually remove selected cookies
|
|
541
|
+
if (isGoogleConsentGranted && cookie.includes('_g')) isGoogleConsentGranted = false; // deny google cookie consent for _gcl_au, _ga, _gid, _gat_UA-31842-13, etc
|
|
544
542
|
});
|
|
545
543
|
});
|
|
544
|
+
window.grantCookieConsent(isGoogleConsentGranted); // grant consent for setting google cookies
|
|
546
545
|
};
|