feat: new subscription

This commit is contained in:
Nevo David 2024-09-17 22:13:41 +07:00
parent 8ec8e225eb
commit 10363131e6
2 changed files with 20 additions and 1 deletions

View File

@ -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 }) => {
<ShowLinkedinCompany />
<Toaster />
<ShowPostSelector />
{(user.tier !== 'FREE' || !isGeneral() || process.env.isBillingEnabled === "false") && <Onboarding />}
<NewSubscription />
{user.tier !== 'FREE' && <Onboarding />}
<Support />
<ContinueProvider />
<div className="min-h-[100vh] w-full max-w-[1440px] mx-auto bg-primary px-[12px] text-textColor flex flex-col">

View File

@ -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;
}