diff --git a/README.md b/README.md index cdc2907..143dfc0 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ It's good to specialize in one thing, if we are experts in related abilities we - [ ] waitlist - [ ] survey - [ ] lighthouse report +- [ ] hooks ## Preview diff --git a/src/client/components/website/WebsiteCodeBtn.tsx b/src/client/components/website/WebsiteCodeBtn.tsx index ca16ebc..c2f7cda 100644 --- a/src/client/components/website/WebsiteCodeBtn.tsx +++ b/src/client/components/website/WebsiteCodeBtn.tsx @@ -11,6 +11,7 @@ import { } from '../ui/dialog'; import { useTranslation } from '@i18next-toolkit/react'; import { Typography } from 'antd'; +import { useGlobalConfig } from '@/hooks/useConfig'; interface WebsiteCodeBtnProps { websiteId: string; @@ -18,8 +19,9 @@ interface WebsiteCodeBtnProps { export const WebsiteCodeBtn: React.FC = React.memo( (props) => { const { t } = useTranslation(); + const { customTrackerScriptName = 'tracker.js' } = useGlobalConfig(); - const trackScript = ``; + const trackScript = ``; return ( diff --git a/src/server/trpc/routers/global.ts b/src/server/trpc/routers/global.ts index 871406e..80d12d9 100644 --- a/src/server/trpc/routers/global.ts +++ b/src/server/trpc/routers/global.ts @@ -22,6 +22,7 @@ export const globalRouter = router({ mapboxToken: z.string().optional(), alphaMode: z.boolean(), disableAnonymousTelemetry: z.boolean(), + customTrackerScriptName: z.string().optional(), }) ) .query(async ({ input }) => { @@ -32,6 +33,7 @@ export const globalRouter = router({ mapboxToken: env.mapboxToken, alphaMode: env.alphaMode, disableAnonymousTelemetry: env.disableAnonymousTelemetry, + customTrackerScriptName: env.customTrackerScriptName, }; }), });