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
2024-04-03 15:32:34 +08:00
import { AxiomWebVitals } from 'next-axiom' ;
2024-01-31 22:32:42 +11:00
import { PublicEnvScript } from 'next-runtime-env' ;
2024-01-25 10:48:20 +02:00
2023-09-20 13:48:30 +10:00
import { FeatureFlagProvider } from '@documenso/lib/client-only/providers/feature-flag' ;
2024-08-27 20:34:39 +09:00
import { I18nClientProvider } from '@documenso/lib/client-only/providers/i18n.client' ;
import { setupI18nSSR } from '@documenso/lib/client-only/providers/i18n.server' ;
import { IS_APP_WEB_I18N_ENABLED , NEXT_PUBLIC_WEBAPP_URL } from '@documenso/lib/constants/app' ;
2023-09-20 13:48:30 +10:00
import { getServerComponentAllFlags } from '@documenso/lib/server-only/feature-flags/get-server-component-feature-flag' ;
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' ;
2023-07-26 18:52:53 +10:00
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-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
2024-02-12 01:29:22 +00:00
export function generateMetadata() {
return {
title : {
template : '%s - Documenso' ,
default : 'Documenso' ,
} ,
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.' ,
2024-02-12 01:29:22 +00:00
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' ,
metadataBase : new URL ( NEXT_PUBLIC_WEBAPP_URL ( ) ? ? 'http://localhost:3000' ) ,
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' ,
images : [ '/opengraph-image.jpg' ] ,
} ,
twitter : {
site : '@documenso' ,
card : 'summary_large_image' ,
images : [ '/opengraph-image.jpg' ] ,
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-06-09 18:21:18 +10:00
2023-08-18 20:05:14 +10:00
export default async function RootLayout ( { children } : { children : React.ReactNode } ) {
const flags = await getServerComponentAllFlags ( ) ;
2024-09-10 12:38:08 +10:00
const { i18n , lang , locales } = setupI18nSSR ( ) ;
2024-08-27 20:34:39 +09:00
2023-06-09 18:21:18 +10:00
return (
2023-08-17 19:56:18 +10:00
< html
2024-08-27 20:34:39 +09:00
lang = { lang }
2023-08-17 19:56:18 +10:00
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" / >
2024-08-27 20:34:39 +09:00
{ IS_APP_WEB_I18N_ENABLED && < meta name = "google" content = "notranslate" / > }
2024-01-25 10:48:20 +02:00
< PublicEnvScript / >
2023-06-09 18:21:18 +10:00
< / head >
2024-04-03 15:32:34 +08:00
< AxiomWebVitals / >
2023-08-18 20:05:14 +10:00
< Suspense >
< PostHogPageview / >
< / Suspense >
2023-06-09 18:21:18 +10:00
< body >
2024-09-10 12:38:08 +10:00
< FeatureFlagProvider initialFlags = { flags } >
< ThemeProvider attribute = "class" defaultTheme = "system" enableSystem >
< TooltipProvider >
< TrpcProvider >
< I18nClientProvider
initialLocaleData = { { lang , locales } }
initialMessages = { i18n . messages }
>
{ children }
< / I18nClientProvider >
< / TrpcProvider >
< / TooltipProvider >
< / ThemeProvider >
< Toaster / >
< / FeatureFlagProvider >
2023-06-09 18:21:18 +10:00
< / body >
< / html >
) ;
}