@bytebrand/fe-ui-core 4.1.69 → 4.1.71
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 +1 -1
- package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.tsx +2 -2
- package/source/components/_common/UserMenu/MaterialMenu.tsx +1 -0
- package/source/components/_common/UserMenu/MaterialMenuItem.tsx +5 -2
- package/source/framework/utils/CommonUtils.ts +7 -2
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ import { updateCookieList } from '../../../../../framework/utils/CommonUtils';
|
|
|
11
11
|
|
|
12
12
|
import styles from './ManageCookieModal.styl';
|
|
13
13
|
|
|
14
|
-
const ManageCookieModal = ({
|
|
14
|
+
const ManageCookieModal = ({ toggleModal }) => {
|
|
15
15
|
const [analytcisMasterSwitch, setAnalyticsMasterSwitch] = useState(true);
|
|
16
16
|
const [marketingMasterSwitch, setMarketingMasterSwitch] = useState(true);
|
|
17
17
|
const [analyticsSwitches, setAnalyticsSwitches] = useState({});
|
|
@@ -62,7 +62,7 @@ const ManageCookieModal = ({ onClearModalState }) => {
|
|
|
62
62
|
};
|
|
63
63
|
localStorage.setItem('cookieConfig', JSON.stringify(cookieConfig));
|
|
64
64
|
updateCookieList();
|
|
65
|
-
|
|
65
|
+
toggleModal();
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
return (
|
|
@@ -17,7 +17,7 @@ interface IListItem {
|
|
|
17
17
|
Link?: any;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const ListItem = ({ icon, label, amount, divider, onClick, href, isComponent, Link }: IListItem) => {
|
|
20
|
+
const ListItem = ({ icon, label, amount, divider, onClick, href, isComponent, Link, handleClose }: IListItem) => {
|
|
21
21
|
return !!href ? (
|
|
22
22
|
<Link color='#4C4E64DE' variant='caption' to={href} underline='none' onClick={onClick}>
|
|
23
23
|
<MenuItem
|
|
@@ -34,7 +34,10 @@ const ListItem = ({ icon, label, amount, divider, onClick, href, isComponent, Li
|
|
|
34
34
|
</Link>
|
|
35
35
|
) : (
|
|
36
36
|
<MenuItem
|
|
37
|
-
onClick={
|
|
37
|
+
onClick={() => {
|
|
38
|
+
onClick();
|
|
39
|
+
handleClose();
|
|
40
|
+
}}
|
|
38
41
|
divider={divider}
|
|
39
42
|
disableRipple={isComponent ? true : false}
|
|
40
43
|
isComponent={isComponent}
|
|
@@ -528,14 +528,19 @@ export function setUtmParameters() {
|
|
|
528
528
|
const expiresDate = new Date();
|
|
529
529
|
expiresDate.setDate(expiresDate.getDate() + 1);
|
|
530
530
|
|
|
531
|
-
|
|
531
|
+
const parsedUrl = new URL(window.location.href);
|
|
532
|
+
const domain = parsedUrl.hostname.split('.').slice(-2).join('.');
|
|
533
|
+
|
|
534
|
+
document.cookie = `marketing=${JSON.stringify(marketing)};expires=${expiresDate};domain=.${domain};path=/`;
|
|
532
535
|
};
|
|
533
536
|
|
|
534
537
|
export const updateCookieList = () => {
|
|
535
538
|
const cookieConfig = JSON.parse(localStorage.getItem('cookieConfig')) || {};
|
|
539
|
+
const parsedUrl = new URL(window.location.href);
|
|
540
|
+
const domain = parsedUrl.hostname.split('.').slice(-2).join('.');
|
|
536
541
|
Object.keys(cookieConfig).forEach((group: string) => {
|
|
537
542
|
cookieConfig[group].forEach((cookie: string) => {
|
|
538
|
-
Cookies.remove(cookie, { path: '/', domain
|
|
543
|
+
Cookies.remove(cookie, { path: '/', domain });
|
|
539
544
|
})
|
|
540
545
|
});
|
|
541
546
|
};
|