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