Skip to content

Commit

Permalink
chore: add google analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmclin2 committed Oct 14, 2024
1 parent 2b6bfdb commit 0560c17
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 7 deletions.
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;

0 comments on commit 0560c17

Please sign in to comment.