Skip to content

Commit

Permalink
feat: new subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevo David committed Sep 17, 2024
1 parent 8ec8e22 commit 1036313
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/frontend/src/components/layout/layout.settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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">
Expand Down
17 changes: 17 additions & 0 deletions apps/frontend/src/components/layout/new.subscription.tsx
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 1036313

Please sign in to comment.