1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "@hoarder/tailwind-config/globals.css";
import type { Viewport } from "next";
import React from "react";
import { cookies } from "next/headers";
import { Toaster } from "@/components/ui/toaster";
import Providers from "@/lib/providers";
import {
defaultUserLocalSettings,
parseUserLocalSettings,
USER_LOCAL_SETTINGS_COOKIE_NAME,
} from "@/lib/userLocalSettings/types";
import { getServerAuthSession } from "@/server/auth";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import { clientConfig } from "@hoarder/shared/config";
const inter = Inter({
subsets: ["latin"],
fallback: ["sans-serif"],
});
export const metadata: Metadata = {
title: "Hoarder",
applicationName: "Hoarder",
description:
"The Bookmark Everything app. Hoard links, notes, and images and they will get automatically tagged AI.",
manifest: "/manifest.json",
appleWebApp: {
capable: true,
title: "Hoarder",
},
formatDetection: {
telephone: false,
},
};
export const viewport: Viewport = {
width: "device-width",
initialScale: 1,
maximumScale: 1,
userScalable: false,
};
export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const session = await getServerAuthSession();
return (
<html lang="en">
<body className={inter.className}>
<Providers
session={session}
clientConfig={clientConfig}
userLocalSettings={
parseUserLocalSettings(
cookies().get(USER_LOCAL_SETTINGS_COOKIE_NAME)?.value,
) ?? defaultUserLocalSettings()
}
>
{children}
<ReactQueryDevtools initialIsOpen={false} />
</Providers>
<Toaster />
</body>
</html>
);
}
|