- {isOX && images?.length === 0 ? (
-
- ) : (
- images?.map((src, index) => (
-
1 ? 'h-1/2' : 'h-full'}
- key={`${src}-${index}`}
- >
-

+
+
+
+
+
+
+
+ {categoryTitle}
+
+
+
+
+ {quizDescription}
+
- ))
- )}
+
+
+ {isOX && images?.length === 0 ? (
+
+ ) : (
+ images?.map((src, index) => (
+
1 ? 'h-1/2' : 'h-full'}
+ key={`${src}-${index}`}
+ >
+

+
+ ))
+ )}
+
+
-
+
);
};
diff --git a/src/common/components/FloatingButton/index.tsx b/src/common/components/FloatingButton/index.tsx
index 4efa9512..abfa1e37 100644
--- a/src/common/components/FloatingButton/index.tsx
+++ b/src/common/components/FloatingButton/index.tsx
@@ -1,6 +1,7 @@
import clsx from 'clsx';
import Image from 'next/image';
+import { LogClickEvent } from '@/common';
import { ICON_URL } from '@/common/constants';
export function FloatingButton({
@@ -8,21 +9,25 @@ export function FloatingButton({
...rest
}: React.ButtonHTMLAttributes
) {
return (
-
-
-
+
+
+
+
+
);
}
diff --git a/src/common/components/LogClickEvent/index.ts b/src/common/components/LogClickEvent/index.ts
index fb44f117..aafba2d6 100644
--- a/src/common/components/LogClickEvent/index.ts
+++ b/src/common/components/LogClickEvent/index.ts
@@ -22,7 +22,7 @@ export const LogClickEvent = ({ children, eventPath }: LogClickEventProps) => {
return cloneElement(child, {
onClick: () => {
- logEvent(analytics, eventName);
+ analytics && logEvent(analytics, eventName);
},
});
};
diff --git a/src/common/components/index.ts b/src/common/components/index.ts
index 5f267d5b..d454e297 100644
--- a/src/common/components/index.ts
+++ b/src/common/components/index.ts
@@ -17,3 +17,4 @@ export * from './Toast';
export * from './BackHeader';
export * from './ToksCalendar';
export * from './NoticeSlider';
+export * from './LogClickEvent';
diff --git a/src/common/utils/firebase.ts b/src/common/utils/firebase.ts
index c823f3ad..38dddc0b 100644
--- a/src/common/utils/firebase.ts
+++ b/src/common/utils/firebase.ts
@@ -1,7 +1,7 @@
import { getAnalytics } from 'firebase/analytics';
import { getApp, getApps, initializeApp } from 'firebase/app';
-export const firebaseConfig = {
+const firebaseConfig = {
apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN,
projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
@@ -13,6 +13,7 @@ export const firebaseConfig = {
const app = !getApps().length ? initializeApp(firebaseConfig) : getApp();
-const analytics = getAnalytics(app);
+const analytics =
+ app.name && typeof window !== 'undefined' ? getAnalytics(app) : null;
-export { analytics };
+export { firebaseConfig, app, analytics };