Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/frontend/src/app/(app)/(site)/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default function RootPage() {
// This page will never actually render because middleware
// redirects to /launches or /analytics before it can load
// But having it here prevents Next.js from showing 404
return null;
}
24 changes: 17 additions & 7 deletions apps/frontend/src/app/(app)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ const jakartaSans = Plus_Jakarta_Sans({

export default async function AppLayout({ children }: { children: ReactNode }) {
const allHeaders = headers();
const Plausible = !!process.env.STRIPE_PUBLISHABLE_KEY
? PlausibleProvider
: Fragment;
const isPlausibleEnabled = !!process.env.STRIPE_PUBLISHABLE_KEY;
const plausibleDomain = !!process.env.IS_GENERAL ? 'postiz.com' : 'gitroom.com';

return (
<html>
<head>
Expand Down Expand Up @@ -83,9 +83,19 @@ export default async function AppLayout({ children }: { children: ReactNode }) {
<HtmlComponent />
<ToltScript />
<FacebookComponent />
<Plausible
domain={!!process.env.IS_GENERAL ? 'postiz.com' : 'gitroom.com'}
>
{isPlausibleEnabled ? (
<PlausibleProvider domain={plausibleDomain}>
<PHProvider
phkey={process.env.NEXT_PUBLIC_POSTHOG_KEY}
host={process.env.NEXT_PUBLIC_POSTHOG_HOST}
>
<LayoutContext>
<UtmSaver />
{children}
</LayoutContext>
</PHProvider>
</PlausibleProvider>
) : (
<PHProvider
phkey={process.env.NEXT_PUBLIC_POSTHOG_KEY}
host={process.env.NEXT_PUBLIC_POSTHOG_HOST}
Expand All @@ -95,7 +105,7 @@ export default async function AppLayout({ children }: { children: ReactNode }) {
{children}
</LayoutContext>
</PHProvider>
</Plausible>
)}
</SentryComponent>
</VariableContextComponent>
</body>
Expand Down
Loading