mirror of
https://github.com/Vikeo/LifeTrinket.git
synced 2025-11-18 08:48:00 +00:00
Compare commits
5 Commits
fix/analyt
...
chore/pack
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6dd0bc777 | ||
|
|
55c02385b5 | ||
|
|
6690a3b256 | ||
|
|
c5bb7eb04b | ||
|
|
de99c0b7e9 |
@@ -1,7 +1,11 @@
|
|||||||
{
|
{
|
||||||
"hosting": {
|
"hosting": {
|
||||||
"public": "dist",
|
"public": "dist",
|
||||||
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
|
"ignore": [
|
||||||
|
"firebase.json",
|
||||||
|
"**/.*",
|
||||||
|
"**/node_modules/**"
|
||||||
|
],
|
||||||
"rewrites": [
|
"rewrites": [
|
||||||
{
|
{
|
||||||
"source": "**",
|
"source": "**",
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ const Container = twc.div<RotationDivProps>((props) => [
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
export const ExtraCountersGrid = twc.div<RotationDivProps>((props) => [
|
export const ExtraCountersGrid = twc.div<RotationDivProps>((props) => [
|
||||||
'flex absolute flex-grow pointer-events-none',
|
'flex absolute flex-row flex-grow pointer-events-none overflow-x-scroll overflow-y-hidden ',
|
||||||
props.$rotation === Rotation.SideFlipped || props.$rotation === Rotation.Side
|
props.$rotation === Rotation.SideFlipped || props.$rotation === Rotation.Side
|
||||||
? 'flex-col h-full w-auto overflow-y-scroll overflow-x-hidden bottom-auto right-0'
|
? 'flex-col-reverse h-full w-auto bottom-auto right-0'
|
||||||
: 'flex-row w-full overflow-x-scroll overflow-y-hidden bottom-0',
|
: 'w-full bottom-0',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
type ExtraCountersBarProps = {
|
type ExtraCountersBarProps = {
|
||||||
|
|||||||
@@ -1,30 +1,17 @@
|
|||||||
import { initializeApp } from 'firebase/app';
|
import { initializeApp } from 'firebase/app';
|
||||||
import { Analytics, getAnalytics, logEvent } from 'firebase/analytics';
|
import { getAnalytics, logEvent } from 'firebase/analytics';
|
||||||
|
|
||||||
const firebaseConfig = {
|
const firebaseConfig = {
|
||||||
apiKey: 'AIzaSyCZ1AHMb5zmWS4VoRnC-OBxTswUfrJ0mlY',
|
apiKey: 'AIzaSyCZ1AHMb5zmWS4VoRnC-OBxTswUfrJ0mlY',
|
||||||
authDomain: 'life-trinket.firebaseapp.com',
|
authDomain: 'life-trinket.firebaseapp.com',
|
||||||
projectId: 'life-trinket',
|
projectId: 'life-trinket',
|
||||||
storageBucket: 'life-trinket.firebasestorage.app',
|
storageBucket: 'life-trinket.appspot.com',
|
||||||
messagingSenderId: '508011650619',
|
messagingSenderId: '508011650619',
|
||||||
appId: '1:508011650619:web:bdc7d0b6f8707b1f9e861e',
|
appId: '1:508011650619:web:bdc7d0b6f8707b1f9e861e',
|
||||||
measurementId: 'G-BE86QSSG14',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const app = initializeApp(firebaseConfig);
|
const app = initializeApp(firebaseConfig);
|
||||||
let analytics: Analytics | null = null;
|
const analytics = getAnalytics(app);
|
||||||
|
|
||||||
const getAnalyticsInstance = () => {
|
|
||||||
if (!analytics) {
|
|
||||||
try {
|
|
||||||
analytics = getAnalytics(app);
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Failed to initialize Firebase Analytics:', error);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return analytics;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const useAnalytics = () => {
|
export const useAnalytics = () => {
|
||||||
const trackEvent = (
|
const trackEvent = (
|
||||||
@@ -36,18 +23,12 @@ export const useAnalytics = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const analyticsInstance = getAnalyticsInstance();
|
|
||||||
if (!analyticsInstance) {
|
|
||||||
console.warn('Analytics not available');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const paramsWithVersion = {
|
const paramsWithVersion = {
|
||||||
...eventParams,
|
...eventParams,
|
||||||
app_version: import.meta.env.VITE_APP_VERSION,
|
app_version: import.meta.env.VITE_APP_VERSION,
|
||||||
};
|
};
|
||||||
|
|
||||||
logEvent(analyticsInstance, eventName, paramsWithVersion);
|
logEvent(analytics, eventName, paramsWithVersion);
|
||||||
};
|
};
|
||||||
|
|
||||||
return { trackEvent };
|
return { trackEvent };
|
||||||
|
|||||||
Reference in New Issue
Block a user