Files
sign/apps/web/src/app/layout.tsx

87 lines
4.0 KiB
TypeScript
Raw Normal View History

2023-08-18 20:05:14 +10:00
import { Suspense } from 'react';
2023-08-17 19:56:18 +10:00
import { Caveat, Inter } from 'next/font/google';
2023-06-09 18:21:18 +10:00
2023-09-20 13:48:30 +10:00
import { FeatureFlagProvider } from '@documenso/lib/client-only/providers/feature-flag';
import { LocaleProvider } from '@documenso/lib/client-only/providers/locale';
2023-09-20 13:48:30 +10:00
import { getServerComponentAllFlags } from '@documenso/lib/server-only/feature-flags/get-server-component-feature-flag';
import { getLocale } from '@documenso/lib/server-only/headers/get-locale';
2023-06-09 18:21:18 +10:00
import { TrpcProvider } from '@documenso/trpc/react';
2023-08-17 19:56:18 +10:00
import { cn } from '@documenso/ui/lib/utils';
2023-06-09 18:21:18 +10:00
import { Toaster } from '@documenso/ui/primitives/toaster';
import { TooltipProvider } from '@documenso/ui/primitives/tooltip';
2023-06-09 18:21:18 +10:00
2023-06-11 01:50:19 -04:00
import { ThemeProvider } from '~/providers/next-theme';
2023-06-09 18:21:18 +10:00
import { PlausibleProvider } from '~/providers/plausible';
2023-08-18 20:05:14 +10:00
import { PostHogPageview } from '~/providers/posthog';
2023-06-09 18:21:18 +10:00
import './globals.css';
const fontInter = Inter({ subsets: ['latin'], variable: '--font-sans' });
2023-08-17 19:56:18 +10:00
const fontCaveat = Caveat({ subsets: ['latin'], variable: '--font-signature' });
2023-06-09 18:21:18 +10:00
export const metadata = {
title: 'Documenso - The Open Source DocuSign Alternative',
description:
'Join Documenso, the open signing infrastructure, and get a 10x better signing experience. Pricing starts at $30/mo. forever! Sign in now and enjoy a faster, smarter, and more beautiful document signing process. Integrates with your favorite tools, customizable, and expandable. Support our mission and become a part of our open-source community.',
keywords:
'Documenso, open source, DocuSign alternative, document signing, open signing infrastructure, open-source community, fast signing, beautiful signing, smart templates',
authors: { name: 'Documenso, Inc.' },
robots: 'index, follow',
openGraph: {
title: 'Documenso - The Open Source DocuSign Alternative',
description:
'Join Documenso, the open signing infrastructure, and get a 10x better signing experience. Pricing starts at $30/mo. forever! Sign in now and enjoy a faster, smarter, and more beautiful document signing process. Integrates with your favorite tools, customizable, and expandable. Support our mission and become a part of our open-source community.',
type: 'website',
2023-09-14 15:00:14 +10:00
images: [`${process.env.NEXT_PUBLIC_WEBAPP_URL}/opengraph-image.jpg`],
2023-06-09 18:21:18 +10:00
},
twitter: {
site: '@documenso',
card: 'summary_large_image',
2023-09-14 15:00:14 +10:00
images: [`${process.env.NEXT_PUBLIC_WEBAPP_URL}/opengraph-image.jpg`],
2023-06-09 18:21:18 +10:00
description:
'Join Documenso, the open signing infrastructure, and get a 10x better signing experience. Pricing starts at $30/mo. forever! Sign in now and enjoy a faster, smarter, and more beautiful document signing process. Integrates with your favorite tools, customizable, and expandable. Support our mission and become a part of our open-source community.',
},
};
2023-08-18 20:05:14 +10:00
export default async function RootLayout({ children }: { children: React.ReactNode }) {
const flags = await getServerComponentAllFlags();
const locale = getLocale();
2023-06-09 18:21:18 +10:00
return (
2023-08-17 19:56:18 +10:00
<html
lang="en"
className={cn(fontInter.variable, fontCaveat.variable)}
suppressHydrationWarning
>
2023-06-09 18:21:18 +10:00
<head>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" />
</head>
2023-08-18 20:05:14 +10:00
<Suspense>
<PostHogPageview />
</Suspense>
2023-06-09 18:21:18 +10:00
<body>
<LocaleProvider locale={locale}>
<FeatureFlagProvider initialFlags={flags}>
<PlausibleProvider>
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
<TooltipProvider>
<TrpcProvider>{children}</TrpcProvider>
</TooltipProvider>
</ThemeProvider>
</PlausibleProvider>
2023-09-24 14:45:50 +10:00
<Toaster />
</FeatureFlagProvider>
</LocaleProvider>
2023-06-09 18:21:18 +10:00
</body>
</html>
);
}