Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add google analytics #150

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"@lobehub/icons": "^1.34.0",
"@lobehub/tts": "^1.25.1",
"@lobehub/ui": "^1.151.0",
"@next/third-parties": "^14.2.15",
"@pixiv/three-vrm": "2.1.2",
"@pixiv/three-vrm-core": "2.1.2",
"@react-spring/web": "^9.7.4",
Expand Down
11 changes: 5 additions & 6 deletions src/app/chat/ChatInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ import { Flexbox } from 'react-layout-kit';
import { CHAT_HEADER_HEIGHT, CHAT_INFO_MAX_WIDTH, CHAT_INFO_WIDTH } from '@/constants/token';
import { useGlobalStore } from '@/store/global';

import BackGround from './BackGroundList';
// import ChatList from './ChatList';
import DanceList from './DanceList';
import MotionList from './MotionList';
import PostureList from './PostureList';
import StageList from './StageList';
import { Tab } from './type';

const BackGround = dynamic(() => import('./BackGroundList'), { ssr: false });
const DanceList = dynamic(() => import('./DanceList'), { ssr: false });
const MotionList = dynamic(() => import('./MotionList'), { ssr: false });
const ChatList = dynamic(() => import('./ChatList'), { ssr: false });
const PostureList = dynamic(() => import('./PostureList'), { ssr: false });
const StageList = dynamic(() => import('./StageList'), { ssr: false });

const useStyles = createStyles(({ css, token }) => ({
content: css`
Expand Down
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Analytics } from '@vercel/analytics/react';
import { PropsWithChildren } from 'react';

import Analytics from '@/components/Analytics';
import NProgress from '@/components/NProgress';
import Layout from '@/layout';

Expand Down
5 changes: 5 additions & 0 deletions src/components/Analytics/Google.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { GoogleAnalytics as GA } from '@next/third-parties/google';

const GoogleAnalytics = () => <GA gaId={process.env.GOOGLE_ANALYTICS_MEASUREMENT_ID!} />;

export default GoogleAnalytics;
5 changes: 5 additions & 0 deletions src/components/Analytics/Goolge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { GoogleAnalytics as GA } from '@next/third-parties/google';

const GoogleAnalytics = () => <GA gaId={process.env.GOOGLE_ANALYTICS_MEASUREMENT_ID!} />;

export default GoogleAnalytics;
5 changes: 5 additions & 0 deletions src/components/Analytics/Vercel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Analytics } from '@vercel/analytics/react';

const VercelAnalytics = () => <Analytics />;

export default VercelAnalytics;
13 changes: 13 additions & 0 deletions src/components/Analytics/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Google from './Goolge';
import Vercel from './Vercel';

const Analytics = () => {
return (
<>
{<Vercel />}
{<Google />}
</>
);
};

export default Analytics;
Loading