File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed
libraries/react-shared-libraries/src/helpers Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ export default async function AppLayout({ children }: { children: ReactNode }) {
4141 isGeneral = { ! ! process . env . IS_GENERAL }
4242 uploadDirectory = { process . env . NEXT_PUBLIC_UPLOAD_STATIC_DIRECTORY ! }
4343 tolt = { process . env . NEXT_PUBLIC_TOLT ! }
44+ facebookPixel = { process . env . NEXT_PUBLIC_FACEBOOK_PIXEL ! }
4445 >
4546 < ToltScript />
4647 < FacebookComponent />
Original file line number Diff line number Diff line change @@ -2,14 +2,16 @@ import { TrackEnum } from '@gitroom/nestjs-libraries/user/track.enum';
22import { useUser } from '@gitroom/frontend/components/layout/user.context' ;
33import { useFetch } from '@gitroom/helpers/utils/custom.fetch' ;
44import { useCallback } from 'react' ;
5+ import { useVariables } from '@gitroom/react/helpers/variable.context' ;
56
67export const useTrack = ( ) => {
78 const user = useUser ( ) ;
89 const fetch = useFetch ( ) ;
10+ const { facebookPixel} = useVariables ( ) ;
911
1012 return useCallback (
1113 async ( track : TrackEnum , additional ?: Record < string , any > ) => {
12- if ( ! process . env . NEXT_PUBLIC_FACEBOOK_PIXEL ) {
14+ if ( ! facebookPixel ) {
1315 return ;
1416 }
1517
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ interface VariableContextInterface {
1111 backendUrl : string ;
1212 discordUrl : string ;
1313 uploadDirectory : string ;
14+ facebookPixel : string ;
1415 tolt : string ;
1516}
1617const VariableContext = createContext ( {
@@ -22,6 +23,7 @@ const VariableContext = createContext({
2223 backendUrl : '' ,
2324 discordUrl : '' ,
2425 uploadDirectory : '' ,
26+ facebookPixel : '' ,
2527 tolt : '' ,
2628} as VariableContextInterface ) ;
2729
You can’t perform that action at this time.
0 commit comments