tycho-components 0.0.15-SNAPSHOT-8 → 0.0.15-SNAPSHOT-9
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/dist/AppAnalytics/AppAnalytics.d.ts +1 -0
- package/dist/AppAnalytics/AppAnalytics.js +25 -0
- package/dist/AppAnalytics/index.d.ts +2 -0
- package/dist/AppAnalytics/index.js +2 -0
- package/dist/Header/HeaderCorpora/HeaderCorpora.js +1 -1
- package/dist/Header/HeaderCorpora/style.scss +9 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function AppAnalytics(): null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
export default function AppAnalytics() {
|
|
3
|
+
const GA_ID = import.meta.env.VITE_APP_GA_ID;
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
if (!GA_ID) {
|
|
6
|
+
console.warn('Google Analytics ID not set.');
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
// Inject the gtag.js script
|
|
10
|
+
const script = document.createElement('script');
|
|
11
|
+
script.src = `https://www.googletagmanager.com/gtag/js?id=${GA_ID}`;
|
|
12
|
+
script.async = true;
|
|
13
|
+
document.head.appendChild(script);
|
|
14
|
+
// Inject the inline gtag config script exactly like GA docs do
|
|
15
|
+
const inlineScript = document.createElement('script');
|
|
16
|
+
inlineScript.innerHTML = `
|
|
17
|
+
window.dataLayer = window.dataLayer || [];
|
|
18
|
+
function gtag(){dataLayer.push(arguments);}
|
|
19
|
+
gtag('js', new Date());
|
|
20
|
+
gtag('config', '${GA_ID}');
|
|
21
|
+
`;
|
|
22
|
+
document.head.appendChild(inlineScript);
|
|
23
|
+
}, []);
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
@@ -56,5 +56,5 @@ export default function HeaderCorpora({ navigateCorpora, redirect, autoload, fre
|
|
|
56
56
|
useEffect(() => {
|
|
57
57
|
autoload && loadAndApply();
|
|
58
58
|
}, [autoload]);
|
|
59
|
-
return (_jsxs("div", { className: "header-corpora-container", children: [hasCorpus() && (_jsxs("div", { className: "corpus-container", onClick: handleCorpusClick, children: [_jsx(AppPicture, { src: getCorpus().picture, title: getCorpus().name, className: "
|
|
59
|
+
return (_jsxs("div", { className: "header-corpora-container", children: [hasCorpus() && (_jsxs("div", { className: "header-corpus-container", onClick: handleCorpusClick, children: [_jsx(AppPicture, { src: getCorpus().picture, title: getCorpus().name, className: "header-corpus-image" }), _jsx("span", { children: getCorpus().name })] })), openCorpora && (_jsx(AppModal, { className: "modal-corpora", title: t('label.choose'), close: () => setOpenCorpora(false), children: corpora.map((corpus) => (_jsxs("div", { className: "item", onClick: () => handleChooseCorpus(corpus), children: [_jsx(AppPicture, { src: corpus.picture, title: corpus.name, className: "modal-corpus-image" }), _jsx("span", { children: corpus.name })] }, corpus.uid))) }))] }));
|
|
60
60
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
margin-left: auto;
|
|
4
4
|
margin-right: auto;
|
|
5
5
|
|
|
6
|
-
.corpus-container {
|
|
6
|
+
.header-corpus-container {
|
|
7
7
|
display: flex;
|
|
8
8
|
justify-content: center;
|
|
9
9
|
align-items: center;
|
|
@@ -15,6 +15,12 @@
|
|
|
15
15
|
@include label-large-1;
|
|
16
16
|
color: var(--text-light-fixed);
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
.header-corpus-image {
|
|
20
|
+
border-radius: 50%;
|
|
21
|
+
width: 32px;
|
|
22
|
+
height: 32px;
|
|
23
|
+
}
|
|
18
24
|
}
|
|
19
25
|
}
|
|
20
26
|
|
|
@@ -39,7 +45,8 @@
|
|
|
39
45
|
background-color: var(--layer-hover-1);
|
|
40
46
|
}
|
|
41
47
|
|
|
42
|
-
|
|
48
|
+
.modal-corpus-image {
|
|
49
|
+
border-radius: 50%;
|
|
43
50
|
width: 48px;
|
|
44
51
|
height: 48px;
|
|
45
52
|
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED