diff --git a/apps/frontend/src/components/layout/layout.settings.tsx b/apps/frontend/src/components/layout/layout.settings.tsx index 831b42b8..b444f2e6 100644 --- a/apps/frontend/src/components/layout/layout.settings.tsx +++ b/apps/frontend/src/components/layout/layout.settings.tsx @@ -31,6 +31,7 @@ import { Impersonate } from '@gitroom/frontend/components/layout/impersonate'; import clsx from 'clsx'; import { BillingComponent } from '@gitroom/frontend/components/billing/billing.component'; import dynamic from 'next/dynamic'; +import { NewSubscription } from '@gitroom/frontend/components/layout/new.subscription'; const ModeComponent = dynamic( () => import('@gitroom/frontend/components/layout/mode.component'), { ssr: false } @@ -70,7 +71,8 @@ export const LayoutSettings = ({ children }: { children: ReactNode }) => { - {(user.tier !== 'FREE' || !isGeneral() || process.env.isBillingEnabled === "false") && } + + {user.tier !== 'FREE' && }
diff --git a/apps/frontend/src/components/layout/new.subscription.tsx b/apps/frontend/src/components/layout/new.subscription.tsx new file mode 100644 index 00000000..52a812e8 --- /dev/null +++ b/apps/frontend/src/components/layout/new.subscription.tsx @@ -0,0 +1,17 @@ +import { useSearchParams } from 'next/navigation'; +import { useEffect } from 'react'; +import { useFireEvents } from '@gitroom/helpers/utils/use.fire.events'; + +export const NewSubscription = () =>{ + const query = useSearchParams(); + const fireEvents = useFireEvents(); + + useEffect(() => { + const check = query.get('check'); + if (check) { + fireEvents('purchase'); + } + }, [query]); + + return null; +} \ No newline at end of file